Skip to content

ci: push git tag before publishing release#2861

Open
tjones60 wants to merge 1 commit intomicrosoft:mainfrom
tjones60:vmgstool_git_tag
Open

ci: push git tag before publishing release#2861
tjones60 wants to merge 1 commit intomicrosoft:mainfrom
tjones60:vmgstool_git_tag

Conversation

@tjones60
Copy link
Contributor

Push a git tag before publishing a (draft) GitHub release to ensure the right commit gets associated with the release even if another PR is merged before the draft is published.

@tjones60 tjones60 requested a review from a team as a code owner February 27, 2026 23:35
Copilot AI review requested due to automatic review settings February 27, 2026 23:35
Copy link
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

Updates the Flowey GitHub release publishing node to create and push a git tag before creating a (draft) GitHub release, aiming to ensure the release is tied to the intended commit.

Changes:

  • Create an annotated git tag for the release version.
  • Push the tag to origin prior to invoking gh release create.

Comment on lines +131 to +133
// create the tag to make sure the release is associated with the right commit
flowey::shell_cmd!(rt, "git tag -a {tag} -m {title}").run()?;
flowey::shell_cmd!(rt, "git push origin {tag}").run()?;
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

These git tag/git push commands assume the step is executing inside the correct git checkout and that origin is configured with push credentials. publish_gh_release doesn’t take a repo directory/commit SHA, and in the current pipeline the OpenVMM repo is checked out with persist_credentials: false and allow_persist_credentials: false, so git push is expected to fail (or tag the wrong repo). Consider either (a) adding a repo_dir input and chdir before tagging, and ensuring the checkout allows persisted credentials, or (b) avoiding git push entirely by using the GitHub API/gh release create --target <sha> to bind the release to a specific commit without requiring git auth.

Copilot uses AI. Check for mistakes.
let draft = draft.then_some("--draft");

// create the tag to make sure the release is associated with the right commit
flowey::shell_cmd!(rt, "git tag -a {tag} -m {title}").run()?;
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Creating an annotated tag (git tag -a ... -m ...) requires user.name/user.email to be configured; CI environments often don’t set these by default, which can cause the step to fail before publishing. If the message isn’t required, consider using a lightweight tag instead, or explicitly setting tagger identity via env/git config within the step.

Suggested change
flowey::shell_cmd!(rt, "git tag -a {tag} -m {title}").run()?;
flowey::shell_cmd!(rt, "git tag {tag}").run()?;

Copilot uses AI. Check for mistakes.
Copy link
Member

@benhillis benhillis left a comment

Choose a reason for hiding this comment

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

I wonder if it might be better to have a flow where:

  1. The CI job pushes the tag
  2. A separate workflow publishes the release (triggered by tags)

Copy link
Member

@benhillis benhillis left a comment

Choose a reason for hiding this comment

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

I've decided I am ok with this approach, but I think copilot found a couple real issues that should be fixed.

@benhillis benhillis self-requested a review March 2, 2026 18:21
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