Repository navigation
ci: regenerate packaged action for Dependabot updates #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Refresh Dependabot action bundle | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: package-dependabot-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| package: | ||
| if: github.event.pull_request.user.login == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| persist-credentials: true | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '24.19.0' | ||
| cache: yarn | ||
| - run: yarn install --frozen-lockfile | ||
| - run: yarn build | ||
| - name: Commit updated action bundle | ||
| env: | ||
| BRANCH: ${{ github.event.pull_request.head.ref }} | ||
| EXPECTED_SHA: ${{ github.event.pull_request.head.sha }} | ||
| run: | | ||
| if git diff --quiet -- dist; then | ||
| exit 0 | ||
| fi | ||
| git config user.name 'github-actions[bot]' | ||
| git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
| git add -- dist | ||
| git commit -m 'chore: rebuild packaged action for dependency update' | ||
| git push origin "HEAD:refs/heads/$BRANCH" --force-with-lease="refs/heads/$BRANCH:$EXPECTED_SHA" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Whenever packaging changes Useful? React with 👍 / 👎. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a Dependabot update contains a compromised npm package or build tool, its lifecycle hooks or code loaded by
yarn buildexecute after checkout has persisted a repository-widecontents: writecredential. The checkout input documentation confirms that this credential enables subsequent scripts to run authenticated Git commands, so hostile dependency code could push or delete refs beyond the intendeddistcommit and bypass the branch/SHA restriction in the final command. Run installation and packaging in a read-only job, then pass the generated artifact to a separately isolated writer with narrowly scoped credentials.Useful? React with 👍 / 👎.