-
Notifications
You must be signed in to change notification settings - Fork 0
Tag the release before creating draft #41
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
Conversation
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.
Pull request overview
This PR modifies the release workflow to create a Git tag before generating the GitHub release draft. This ensures the tag exists before the release is created, which is a common best practice in release automation workflows.
Changes:
- Added a new workflow step that creates a Git tag using the GitHub API before the release creation step
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/release.yaml
Outdated
| const tag = process.env.TAG; | ||
| github.rest.git.createRef({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| ref: `refs/tags/${tag}`, | ||
| sha: context.sha | ||
| }) |
Copilot
AI
Feb 3, 2026
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.
The tag creation lacks error handling for the case where the tag already exists. If this workflow is re-run or the tag already exists, it will fail without a clear indication. Consider adding a try-catch block to handle this scenario gracefully, or check if the tag exists before attempting to create it.
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.
@copilot append a commit to this PR to address this feedback (#41 (comment)). If the tag already exists with the same SHA then it should not create the tag and success the step. If the tag already exists with a different SHA then it should fail the step.
Co-authored-by: AButler <1628649+AButler@users.noreply.github.com>
Co-authored-by: AButler <1628649+AButler@users.noreply.github.com>
Co-authored-by: AButler <1628649+AButler@users.noreply.github.com>
Add idempotent tag creation with SHA validation to release workflow
No description provided.