Conversation
There was a problem hiding this comment.
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 | ||
| }) |
There was a problem hiding this comment.
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.
@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.