You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.github/workflows/release.yml, line 199-203 (link)
Shallow clone may fail git tag on COMMIT_HASH
The publish job tags COMMIT_HASH (output from the version-bump job) in a shallow clone. With the default fetch-depth: 1, only the current HEAD of main is fetched. If any other commit lands on main in the window between version-bump completing and publish checking out, git tag -a "$NEW_VERSION" "$COMMIT_HASH" will fail with "fatal: not a valid object name" because COMMIT_HASH won't be present in the local repository. The original fetch-depth: 0 was presumably there to prevent exactly this. The check-changesets and version-bump jobs don't traverse history and are safe without it, but the publish job is the one that actually uses COMMIT_HASH to create the annotated tag.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/release.yml
Line: 199-203
Comment:
**Shallow clone may fail `git tag` on `COMMIT_HASH`**
The `publish` job tags `COMMIT_HASH` (output from the `version-bump` job) in a shallow clone. With the default `fetch-depth: 1`, only the current HEAD of `main` is fetched. If any other commit lands on `main` in the window between `version-bump` completing and `publish` checking out, `git tag -a "$NEW_VERSION" "$COMMIT_HASH"` will fail with "fatal: not a valid object name" because `COMMIT_HASH` won't be present in the local repository. The original `fetch-depth: 0` was presumably there to prevent exactly this. The `check-changesets` and `version-bump` jobs don't traverse history and are safe without it, but the `publish` job is the one that actually uses `COMMIT_HASH` to create the annotated tag.
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---### Issue 1 of 1
.github/workflows/release.yml:199-203
**Shallow clone may fail `git tag` on `COMMIT_HASH`**
The `publish` job tags `COMMIT_HASH` (output from the `version-bump` job) in a shallow clone. With the default `fetch-depth: 1`, only the current HEAD of `main` is fetched. If any other commit lands on `main` in the window between `version-bump` completing and `publish` checking out, `git tag -a "$NEW_VERSION" "$COMMIT_HASH"` will fail with "fatal: not a valid object name" because `COMMIT_HASH` won't be present in the local repository. The original `fetch-depth: 0` was presumably there to prevent exactly this. The `check-changesets` and `version-bump` jobs don't traverse history and are safe without it, but the `publish` job is the one that actually uses `COMMIT_HASH` to create the annotated tag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Add a generated public Ruby API snapshot so CI can detect accidental public API changes before release.
💚 How did you test it?
bundle exec rubocopbundle exec rake public_api:check📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file