feat: update action-tag to use action pins mode (gh-aw-actions) with v0#20991
feat: update action-tag to use action pins mode (gh-aw-actions) with v0#20991
Conversation
…v0 tag - validateActionTag now accepts version tags (v0, v1, v1.0.0) in addition to full SHAs - resolveActionReference uses action mode (github/gh-aw-actions) when frontmatter action-tag is set - daily-fact.md updated to use action-tag: "v0" - Recompiled daily-fact.lock.yml: now uses github/gh-aw-actions/setup@v0 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pkg/workflow/features_validation.go
Outdated
| var shaRegex = regexp.MustCompile("^[0-9a-f]{40}$") | ||
|
|
||
| // versionTagRegex matches version tags like "v0", "v1", "v1.0", "v1.0.0", etc. | ||
| var versionTagRegex = regexp.MustCompile(`^v[0-9]+(\.[0-9]+)*$`) |
There was a problem hiding this comment.
@copilot move version parsing to semver.go . onlyu support vmajor vmajor.minor vmajor.minor.patch
There was a problem hiding this comment.
Done in af06d0d. Moved versionTagRegex and isValidVersionTag to semver.go, and tightened the regex to only support vmajor, vmajor.minor, and vmajor.minor.patch (e.g. v0, v1.2, v1.2.3). Added TestIsValidVersionTag to semver_test.go.
…major.minor/vmajor.minor.patch Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot update daily-facts to use inlined-prompts. |
|
inlined imports |
There was a problem hiding this comment.
Pull request overview
Updates the action-tag frontmatter feature to support version tags (e.g. v0) and to resolve actions via the external action pins repository (github/gh-aw-actions) rather than the internal release repo (github/gh-aw), and applies this to the daily-fact workflow.
Changes:
- Extend
action-tagvalidation to accept semver-like tags (v0,v1,v1.0.0) in addition to full 40-char commit SHAs. - Update action reference resolution so frontmatter
action-tagforces action mode behavior (externalgithub/gh-aw-actionsrefs). - Update
daily-factworkflow configuration + lock/pins data to useaction-tag: "v0"and pingithub/gh-aw-actions/setup@v0.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/semver.go | Adds version-tag regex + helper used by feature validation. |
| pkg/workflow/semver_test.go | Adds unit tests for version-tag validation helper. |
| pkg/workflow/features_validation.go | Allows action-tag to be a full SHA or version tag. |
| pkg/workflow/features_validation_test.go | Updates validation tests for version tags and new error messaging. |
| pkg/workflow/action_reference.go | Routes frontmatter action-tag to external gh-aw-actions action-mode behavior. |
| pkg/workflow/action_reference_test.go | Updates expectations for action-tag to use github/gh-aw-actions. |
| pkg/workflow/data/action_pins.json | Adds pin entry for github/gh-aw-actions/setup@v0. |
| .github/aw/actions-lock.json | Mirrors the new gh-aw-actions/setup@v0 pin in the repo lock JSON. |
| .github/workflows/daily-fact.md | Switches workflow frontmatter action-tag from a SHA to "v0". |
| .github/workflows/daily-fact.lock.yml | Recompiled lock output to use github/gh-aw-actions/setup pinned to the v0 SHA. |
Comments suppressed due to low confidence (2)
pkg/workflow/action_reference_test.go:165
- This test uses a short SHA (
abc123def456789) as a frontmatteraction-tag, but feature validation now requires either a full 40-character commit SHA or a version tag. Consider replacing this with a full 40-char SHA (lowercase hex) or a version tag to keep the test aligned with validated inputs.
localPath: "./actions/setup",
version: "v1.0.0",
actionTag: "abc123def456789",
expectedRef: "github/gh-aw-actions/setup@abc123def456789",
description: "Frontmatter action-tag SHA should use action mode (gh-aw-actions)",
pkg/workflow/action_reference_test.go:174
- Same as above: this scenario uses frontmatter
action-tag: "latest", which is no longer a valid value undervalidateActionTag. Using a valid tag here will prevent the test suite from documenting unsupported configurations.
localPath: "./actions/setup",
version: "v1.0.0",
actionTag: "latest",
expectedRef: "github/gh-aw-actions/setup@latest",
description: "Dev mode with frontmatter action-tag should use action mode (gh-aw-actions)",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| localPath: "./actions/setup", | ||
| version: "v1.0.0", | ||
| actionTag: "latest", | ||
| expectedRef: "github/gh-aw/actions/setup@latest", | ||
| description: "Release mode with action-tag should use action-tag instead of version", | ||
| expectedRef: "github/gh-aw-actions/setup@latest", | ||
| description: "Frontmatter action-tag should use action mode (gh-aw-actions) regardless of compiler mode", |
| // versionTagRegex matches version tags: vmajor, vmajor.minor, or vmajor.minor.patch | ||
| var versionTagRegex = regexp.MustCompile(`^v[0-9]+(\.[0-9]+(\.[0-9]+)?)?$`) | ||
|
|
||
| var semverLog = logger.New("workflow:semver") | ||
|
|
||
| // isValidVersionTag checks if a string is a valid action version tag. | ||
| // Supports vmajor, vmajor.minor, and vmajor.minor.patch formats only. | ||
| func isValidVersionTag(s string) bool { | ||
| return versionTagRegex.MatchString(s) | ||
| } |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Summary
Updates the
action-tagfrontmatter feature to use the action pins mode (github/gh-aw-actions) instead of the release mode (github/gh-aw), setsaction-tag: "v0"in thedaily-factagentic workflow, and enables inlined-imports for thedaily-factworkflow.Changes
pkg/workflow/features_validation.govalidateActionTagto accept version tags (e.g.,v0,v1,v1.0.0) in addition to full 40-char commit SHAspkg/workflow/semver.goversionTagRegexandisValidVersionTaghere (fromfeatures_validation.go)vmajor,vmajor.minor, andvmajor.minor.patchformats onlypkg/workflow/action_reference.goresolveActionReferenceso that whenaction-tagis set in frontmatter features, it uses action mode behavior (github/gh-aw-actions) instead of release mode (github/gh-aw)./actions/setup, passes the frontmatter tag toResolveSetupActionReferencewithActionModeActionconvertToExternalActionsRef.github/workflows/daily-fact.mdaction-tagfroma70c5eada06553e3510ac27f2c3bda9d3705bccbto"v0"inlined-imports: trueso the prompt content is baked directly into the compiled YAML.github/workflows/daily-fact.lock.ymlgithub/gh-aw-actions/setup@v0and has the prompt content inlinedTests
features_validation_test.go: Updated/added test cases for version tag validationaction_reference_test.go: Updated expectations for frontmatteraction-tagto usegithub/gh-aw-actionssemver_test.go: AddedTestIsValidVersionTagcovering valid and invalid version tag formatsSecurity
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.