Skip to content

fix: CI survives force-pushed tags with bad before SHA - #23

Merged
kylegalloway merged 1 commit into
mainfrom
fix/ci-bad-object-before-sha
May 29, 2026
Merged

fix: CI survives force-pushed tags with bad before SHA#23
kylegalloway merged 1 commit into
mainfrom
fix/ci-bad-object-before-sha

Conversation

@kylegalloway

@kylegalloway kylegalloway commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a git cat-file -e check before using github.event.before as a diff base
  • When a tag is force-pushed, the before SHA is the old tag object which no longer exists in the repo, causing git diff to fail with exit 128
  • Falls back to git ls-tree -r --name-only HEAD (list all files) in that case, same as the new-branch path

Test plan

  • CI passes on this PR
  • Force-push a tag and confirm the Detect Changes step no longer fails

When a tag is force-pushed, github.event.before is the old tag object
SHA which no longer exists in the repo. git diff on a bad object exits
128 and kills the Detect Changes step. Fall back to listing all files
when the before SHA fails git cat-file -e.
@kylegalloway
kylegalloway enabled auto-merge May 29, 2026 22:15
@kylegalloway
kylegalloway merged commit 6d98415 into main May 29, 2026
13 checks passed
@kylegalloway
kylegalloway deleted the fix/ci-bad-object-before-sha branch May 29, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant