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
{{ message }}
Repository navigation
gh aw add records source: as a commit SHA, so gh aw update follows the default branch instead of releases #73077
gh aw add owner/repo/workflows/x.md@v1.2.0 writes source: owner/repo/workflows/x.md@<40-char sha>, not @v1.2.0. gh aw update then sees a SHA, and per its help, "if the ref is a commit SHA, it fetches the latest commit from the default branch". So a workflow installed from a release silently starts tracking unreleased main. reference/frontmatter.md shows source: with a tag, and guides/sharing-workflows.md says exact tags stay pinned and @v1 follows releases. Neither works for an installed workflow until the user edits source: by hand.
Root cause
pkg/cli/add_workflow_content.go:287-294 passes sourceInfo.CommitSHA to buildSourceStringWithCommitSHA.
pkg/cli/spec.go:483-512 prefers the commit SHA over workflow.Version whenever one exists ("include the precise commit that was installed").
Reproducibility doesn't depend on the SHA in source:: the lock file and .github/aw/imports/ already pin by SHA.
Implementation plan
In pkg/cli/spec.gobuildSourceStringWithCommitSHA, keep workflow.Version when it is a release tag (isSemanticVersionTag) or a major ref like v1. Use the SHA only when the user gave a SHA or no ref. Do the same for the manifest branch (FromRepositoryManifest).
Optionally record the resolved SHA for auditing somewhere that update doesn't read as the ref, such as the lock file metadata.
Tests in pkg/cli/add_command_test.go and spec_manifest_source_test.go:
@v1.2.0 → source: ...@v1.2.0;
@<sha> → SHA;
a branch ref → the branch name.
Test in pkg/cli/update_workflows_test.go: a workflow added at a tag updates to the next release, not to the default branch head.
Acceptance criteria
gh aw add .../x.md@v1.2.0 followed by gh aw update (once the cool-down allows it) moves the workflow to the newest v1 release.
Activity