Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/package-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- 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
Expand All @@ -39,4 +38,4 @@ jobs:
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"
git push origin "HEAD:refs/heads/$BRANCH"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the expected-SHA guard when pushing the bundle

If the Dependabot PR is closed and its branch is deleted while this job is building, no closed event cancels the workflow and this ordinary refspec push recreates the deleted branch. The removed exact lease rejected that case because the remote ref no longer equaled EXPECTED_SHA; as git push -h documents, --force-with-lease=<refname>:<expect> will “require old value of ref to be at this value.” Keep an atomic expected-SHA guard so a stale job cannot resurrect a deliberately deleted dependency branch.

Useful? React with 👍 / 👎.

Loading