Skip to content

feat: force update all actions to latest major version, add --disable-release-bump flag#18707

Merged
pelikhan merged 3 commits intomainfrom
copilot/refactor-update-command
Feb 27, 2026
Merged

feat: force update all actions to latest major version, add --disable-release-bump flag#18707
pelikhan merged 3 commits intomainfrom
copilot/refactor-update-command

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

gh aw update only force-bumped actions/* core actions to the latest major version. This extends that behavior to all orgs and adds --disable-release-bump to revert to the previous behavior.

Behavior changes

  • Default (gh aw update): all actions in actions-lock.json and all org/repo@version references in workflow .md files are updated to the latest major version, regardless of org
  • gh aw update --disable-release-bump: reverts to old behavior — only actions/* is force-bumped; other orgs respect the --major flag

Implementation

  • actionRefPattern extended from actions/[repo]@... to [org]/[repo]@... (org must start with alphanumeric, excluding local ./ paths)
  • UpdateActions: new disableReleaseBump bool param; effectiveAllowMajor = !disableReleaseBump || allowMajor || isCoreAction(repo)
  • updateActionRefsInContent: new allowMajor bool param; skips non-core refs when allowMajor=false
  • UpdateActionsInWorkflowFiles: passes !disableReleaseBump as allowMajor downstream
  • upgrade_command.go updated to use the new UpdateActions signature (keeps force-all default)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GO111MODULE 64/bin/go node t-10�� k/gh-aw/gh-aw/.github/workflows/brave.md go /usr/bin/git Vp4i/XjBOFxMgj7ygit GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha -json l 8177614/b385/vet.cfg GOINSECURE GOMOD GOMODCACHE go env -json l 1/x64/bin/node GOINSECURE GOMOD GOMODCACHE 1/x64/bin/node (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -json GO111MODULE ache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env 2253-28710/test-4002222553/.github/workflows GO111MODULE .cfg GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha 8177614/b425/_pkg_.a GOPROXY ache/node/24.13.1/x64/bin/node GOSUMDB b/gh-aw/pkg/time-c 64/bin/go git t-33�� sistency_WithImports128271125/001/main.md config ache/node/24.13.1/x64/bin/node remote.origin.urgit GO111MODULE 64/bin/go 8177614/b425/importcfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha user.name Test User /usr/bin/git "prettier" --chegit sh 64/bin/go git init�� 64/bin/go go /opt/hostedtoolcache/node/24.13.1/x64/bin/node -json GO111MODULE 64/bin/go /opt/hostedtoolcache/node/24.13.1/x64/bin/node (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha vaScript3159717178/001/test-fron-test.timeout=10m0s GO111MODULE /opt/hostedtoolcache/go/1.25.0/x-test.short=true GOINSECURE GOMOD GOMODCACHE go env runs/20260227-152253-28710/test-3819704438/.github/workflows GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env runs/20260227-152253-28710/test-723541812/.github/workflows GO111MODULE .cfg l GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha user.name Test User /usr/bin/git prettier --check 64/bin/go git conf�� user.email test@example.com /usr/bin/git ub/workflows -e 64/bin/go git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go m/_n�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha go1.25.0 -c=4 -nolocalimports -importcfg /tmp/go-build3998177614/b390/importcfg -pack /tmp/go-build3998177614/b390/_testmain.go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha ck 'scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE sh (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env runs/20260227-152253-28710/test-4146305795/.github/workflows GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha vaScript3159717178/001/test-frontmatter-with-nested-objects.md GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go estl�� -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 GO111MODULE x_amd64/compile GOINSECURE GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env ty-test.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env hub/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 6387092/b387/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/pkg/consenv GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 b/gh-aw/pkg/fileenv GOMODCACHE go env SAxS/3_r8lQvpEbdGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 6387092/b391/impGOPROXY (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 GOMOD GOMODCACHE x_amd64/compile env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env 3897961638/.github/workflows GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha ty-test.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion GOINSECURE GOMOD GOMODCACHE x_amd64/compile env ty-test.md GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo 64/bin/go GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/xGO111MODULE env 6387092/b371/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE b/gh-aw/cmd/gh-aenv GOMODCACHE go (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build3998177614/b381/cli.test /tmp/go-build3998177614/b381/cli.test -test.testlogfile=/tmp/go-build3998177614/b381/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true GOINSECURE GOMOD GOMODCACHE go env ck 'scripts/**/*GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name GOSUMDB GOWORK 64/bin/go GOINSECURE GOMOD GOMODCACHE go env e=false GO111MODULE 64/bin/go GOINSECURE %H %ct %D GOMODCACHE go (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Refactor the update command to force update all actions just like in #18692 but applied to all orgs.

gh aw update # force update all actions

Add a flag to disable this behavior.

gh aw update --disable-release-bump


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…-release-bump flag

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor update command to force update all actions feat: force update all actions to latest major version, add --disable-release-bump flag Feb 27, 2026
@pelikhan
Copy link
Contributor

@copilot run "update" on the repo

Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot run "update" on the repo

Ran gh aw update — the command executed correctly. It attempted to update 39 actions (including non-actions/* orgs like docker/build-push-action, cli/gh-extension-precompile, anchore/sbom-action, etc.) but all API calls failed due to network/auth restrictions in the sandbox environment. In an authenticated environment with GitHub access, all these actions would be bumped to their latest major versions.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/actions/ai-inference/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/attest-build-provenance/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/attest-build-provenance/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/cache/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/cache/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/checkout/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/releases --jq .[].tag_name (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/releases --jq .[].tag_name .js (http block)
  • https://api.github.com/repos/actions/create-github-app-token/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/create-github-app-token/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/download-artifact/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/github-script/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/setup-dotnet/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-dotnet/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/setup-go/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/setup-java/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-java/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/setup-node/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/setup-python/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-python/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/actions/upload-artifact/releases
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/anchore/sbom-action/releases
    • Triggering command: /usr/bin/gh gh api /repos/anchore/sbom-action/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/releases
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/cli/gh-extension-precompile/releases
    • Triggering command: /usr/bin/gh gh api /repos/cli/gh-extension-precompile/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/denoland/setup-deno/releases
    • Triggering command: /usr/bin/gh gh api /repos/denoland/setup-deno/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/docker/build-push-action/releases
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/docker/login-action/releases
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/docker/metadata-action/releases
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/docker/setup-buildx-action/releases
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/erlef/setup-beam/releases
    • Triggering command: /usr/bin/gh gh api /repos/erlef/setup-beam/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/github/codeql-action/releases
    • Triggering command: /usr/bin/gh gh api /repos/github/codeql-action/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/github/stale-repos/releases
    • Triggering command: /usr/bin/gh gh api /repos/github/stale-repos/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/githubnext/agentics
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics --jq .default_branch (http block)
  • https://api.github.com/repos/haskell-actions/setup/releases
    • Triggering command: /usr/bin/gh gh api /repos/haskell-actions/setup/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/oven-sh/setup-bun/releases
    • Triggering command: /usr/bin/gh gh api /repos/oven-sh/setup-bun/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/ruby/setup-ruby/releases
    • Triggering command: /usr/bin/gh gh api /repos/ruby/setup-ruby/releases --jq .[].tag_name (http block)
  • https://api.github.com/repos/super-linter/super-linter/releases
    • Triggering command: /usr/bin/gh gh api /repos/super-linter/super-linter/releases --jq .[].tag_name (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan marked this pull request as ready for review February 27, 2026 15:52
Copilot AI review requested due to automatic review settings February 27, 2026 15:52
@pelikhan pelikhan merged commit b52abf2 into main Feb 27, 2026
43 checks passed
@pelikhan pelikhan deleted the copilot/refactor-update-command branch February 27, 2026 15:52
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

Extends gh aw update action-version updating to force-bump all referenced GitHub Actions (not just actions/*) to the latest major version by default, and introduces --disable-release-bump to revert to the prior “only force-bump core actions” behavior.

Changes:

  • Added --disable-release-bump flag to the update command and threaded it through RunUpdateWorkflows.
  • Updated UpdateActions and workflow-file scanning to support “force bump all orgs” vs “only force bump core actions” behavior.
  • Expanded action reference matching from actions/* to org/repo@ref in workflow .md files and updated unit tests accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/cli/upgrade_command.go Updated callsite to new UpdateActions signature.
pkg/cli/update_command.go Added --disable-release-bump flag; updated RunUpdateWorkflows wiring and logging.
pkg/cli/update_command_test.go Updated tests for new RunUpdateWorkflows / UpdateActions signatures.
pkg/cli/update_actions_test.go Updated/refined tests and added coverage for “all orgs updated when allowMajor”.
pkg/cli/update_actions.go Implemented new release-bump behavior, broadened action ref regex, and added allowMajor gating for workflow ref updates.

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

Comment on lines +474 to 478
// Requires the org to start with an alphanumeric character and contain only alphanumeric,
// hyphens, or underscores (no dots, matching GitHub's org naming rules) to exclude local
// paths (e.g. "./..."). Repository names may additionally contain dots.
// Captures: (1) indentation+uses prefix, (2) repo path, (3) SHA or version tag,
// (4) optional version comment (e.g., "v6.0.2" from "# v6.0.2"), (5) trailing whitespace.
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.

actionRefPattern’s doc comment doesn’t match what the regex actually captures/permits. In particular, capture group (1) is only uses:\s+ (indentation is not included), and the org pattern currently allows underscores even though the comment states it follows GitHub org naming rules (and explicitly calls out allowed characters). Please either adjust the comment to reflect the actual regex, or tighten the regex to match the documented constraints so future changes don’t rely on incorrect assumptions.

Suggested change
// Requires the org to start with an alphanumeric character and contain only alphanumeric,
// hyphens, or underscores (no dots, matching GitHub's org naming rules) to exclude local
// paths (e.g. "./..."). Repository names may additionally contain dots.
// Captures: (1) indentation+uses prefix, (2) repo path, (3) SHA or version tag,
// (4) optional version comment (e.g., "v6.0.2" from "# v6.0.2"), (5) trailing whitespace.
// Requires the org segment to start with an alphanumeric character and contain only
// alphanumeric characters, hyphens, or underscores (no dots) to exclude local paths
// (e.g. "./..."). This is slightly looser than GitHub's org naming rules, which disallow
// underscores. Repository and subpath segments may additionally contain dots.
// Captures: (1) the "uses:" prefix plus following whitespace (no leading indentation),
// (2) the repo path (org/repo[/subpath...]), (3) the SHA or version tag,
// (4) an optional version comment (e.g., "v6.0.2" from "# v6.0.2"), (5) trailing whitespace.

Copilot uses AI. Check for mistakes.
Comment on lines 597 to 620
@@ -600,7 +616,7 @@ func updateActionRefsInContent(content string, cache map[string]latestReleaseRes
cacheKey := repo + "|" + currentVersion
result, cached := cache[cacheKey]
if !cached {
latestVersion, latestSHA, err := getLatestActionReleaseFn(repo, currentVersion, true, verbose)
latestVersion, latestSHA, err := getLatestActionReleaseFn(repo, currentVersion, effectiveAllowMajor, verbose)
if err != nil {
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.

updateActionRefsInContent will treat any non-SHA ref as a “version tag” and attempt to resolve it via releases. That means refs like uses: owner/repo@main (or other non-semver branch names) can be rewritten to the latest semver release tag, because getLatestActionRelease() treats an unparsable currentVersion as “pick the highest semver release” regardless of allowMajor. This becomes much more likely now that the pattern matches all orgs. Consider explicitly skipping non-semver, non-SHA refs (e.g., only update when ref looks like a semver tag), or changing getLatestActionRelease() to not jump to the highest semver when allowMajor is false and the current ref isn’t semver.

Copilot uses AI. Check for mistakes.
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