Skip to content

correct the tag on release artifact#2683

Open
piyalbasu wants to merge 2 commits intomasterfrom
fix-release-tag
Open

correct the tag on release artifact#2683
piyalbasu wants to merge 2 commits intomasterfrom
fix-release-tag

Conversation

@piyalbasu
Copy link
Copy Markdown
Contributor

@piyalbasu piyalbasu commented Apr 6, 2026

  • Understand current workflow state
  • Add contents: write permissions to the job
  • Make the tag push step idempotent (skip if tag already points to correct SHA, fail with clear message otherwise)
  • Add target_commitish back to the release creation step as a safe fallback

Copilot AI review requested due to automatic review settings April 6, 2026 16:17
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 updates the production release workflow to ensure the created Git tag (and resulting release) points to the exact commit that was checked out (e.g., the emergency-release branch head), rather than unintentionally pointing at the default branch head.

Changes:

  • Push the release tag to origin and explicitly attach it to the checked-out SHA.
  • Remove target_commitish from the GitHub Release creation step (relying on the pre-created tag).
  • Minor YAML formatting adjustments for readability (input description and checkout ref).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +57 to +60
- name: Create and push git tag
run: |
git tag ${{ steps.package_version.outputs.version }} ${{ steps.checkout_sha.outputs.sha }}
git push origin ${{ steps.package_version.outputs.version }}
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

The workflow now performs a git push to create the remote tag. To avoid intermittent failures depending on repository defaults, explicitly grant contents: write permissions (workflow- or job-level) so the GITHUB_TOKEN can push tags. Also consider making this step idempotent: if the tag already exists on the remote (e.g., a rerun), git tag/git push will fail—either detect and skip when it already points to the intended SHA, or fail with a clear message when it points elsewhere.

Copilot uses AI. Check for mistakes.
Comment on lines 61 to 71
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.package_version.outputs.version }}
release_name: ${{ steps.package_version.outputs.version }}
body: ${{ steps.package_version.outputs.version }}
draft: false
prerelease: false
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

target_commitish was removed from the release creation. If the tag push step fails (permissions, existing tag, transient network), actions/create-release may create the tag/release against the workflow’s triggering ref (often the default branch), reintroducing the original problem. Keeping target_commitish: ${{ steps.checkout_sha.outputs.sha }} here provides a safe fallback and ensures the release points at the intended commit even when the tag doesn’t exist yet.

Copilot uses AI. Check for mistakes.
@piyalbasu
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

…et_commitish fallback

Agent-Logs-Url: https://github.com/stellar/freighter/sessions/a1ba948f-e821-4555-99e0-848c1906438f

Co-authored-by: piyalbasu <6789586+piyalbasu@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

@copilot apply changes based on the comments in this thread

Applied all three changes in commit aaa70e0:

  1. Added permissions: contents: write to the job so GITHUB_TOKEN can push tags.
  2. Made the tag push step idempotent — if the tag already exists pointing to the correct SHA it skips gracefully; if it points elsewhere it fails with a clear error message.
  3. Re-added target_commitish: ${{ steps.checkout_sha.outputs.sha }} to the release creation step as a safe fallback.

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.

3 participants