Skip to content

fix: use GetActionPin dynamically in tests instead of hardcoded action SHAs#18725

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/fix-github-actions-workflow-1d0da9d3-1a8a-4844-83eb-47657731186a
Closed

fix: use GetActionPin dynamically in tests instead of hardcoded action SHAs#18725
Copilot wants to merge 3 commits intomainfrom
copilot/fix-github-actions-workflow-1d0da9d3-1a8a-4844-83eb-47657731186a

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Tests hardcoded specific commit SHAs for GitHub Actions (e.g. actions/setup-go@7a3fe6cf...) that broke when action_pins.json was updated to bump action versions.

Changes

  • runtime_integration_test.go: Replace hardcoded SHA check in TestCompileWorkflowWithGoRuntimeWithoutGoMod with GetActionPin("actions/setup-go")
  • runtime_setup_test.go: Same treatment for TestGenerateRuntimeSetupSteps and TestGenerateRuntimeSetupStepsWithIfCondition — covers actions/setup-go, actions/setup-python, astral-sh/setup-uv, actions/setup-dotnet, and actions/setup-java

Before:

if !strings.Contains(lockStr, "actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5") {
    t.Error("Expected actions/setup-go action in lock file")
}

After:

if !strings.Contains(lockStr, GetActionPin("actions/setup-go")) {
    t.Errorf("Expected actions/setup-go action pin '%s' in lock file", GetActionPin("actions/setup-go"))
}

This pattern ensures tests stay valid when action_pins.json is updated, without losing the assertion that SHA-pinning is actually applied.

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 gh auth status (http block)
    • Triggering command: /usr/bin/gh gh auth status 64/pkg/tool/linux_amd64/vet (http block)
    • 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 (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 --noprofile -tests nfig/composer/vendor/bin/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha HEAD bash 1/x64/bin/node --noprofile 9483265/b001/_terev-parse ache/node/24.13.--show-toplevel git arne�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link 1/x64/bin/node (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git 64/bin/bash --show-toplevel git ache/node/24.13.--show-toplevel git _har�� --show-toplevel git ache/node/24.13.1/x64/bin/node --show-toplevel bash /usr/bin/git git (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 a-4844-83eb-47657731186a (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel o "��� Warning: .github/aw/actions-lock.json doe-tests /usr/bin/git -unreachable=falgit /tmp/go-build413rev-parse 64/bin/bash git rev-�� --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git /usr/bin/git --show-current 64/pkg/tool/linurev-parse 1/x64/bin/node git rev-�� --show-toplevel git 1/x64/bin/node --show-toplevel bash 1/x64/bin/node git (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 se 3927346/b028/vet.cfg ache/go/1.25.0/x64/pkg/tool/linu-nilfunc pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha rd (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha /tmp/go-build662085684/b001/workflow.test -importcfg /usr/bin/git -s -w -buildmode=exe git rev-�� --show-toplevel -extld=gcc /snap/bin/bash actions = ['actgit (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 -unreachable=false /tmp/go-build4133927346/b267/vet.cfg 86_64/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -unreachable=false /tmp/go-build4133927346/b226/vet.cfg ache/uv/0.10.7/x86_64/bash (http block)
    • Triggering command: `/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -m initial plan

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> /opt/hostedtoolcache/go/1.25.0/x64/bin/bash INVALID,NEW -j DROP bash --no�� --noprofile 64/pkg/tool/linux_amd64/vet /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link` (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 -unreachable=false /tmp/go-build4133927346/b219/vet.cfg ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -unreachable=false /tmp/go-build4133927346/b270/vet.cfg bin/bash (http block)
    • Triggering command: `/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -m initial plan

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> 6448925/b123/vet.cfg` (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 -unreachable=false stmain.go 1/x64/bin/bash (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel bash /usr/bin/grep --noprofile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git 1/x64/bin/node --show-toplevel bash ache/node/24.13.--show-toplevel git cjs --show-toplevel git ache/node/24.13.1/x64/bin/node --show-toplevel git ache/node/24.13.--show-toplevel git (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 g/workflow/features_import_test.go g/workflow/importable_tools_test.go ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel bash /usr/bin/git --noprofile -tests 64/pkg/tool/linu--show-toplevel git log --oneline -10 1/x64/bin/node --noprofile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git 1/x64/bin/node --show-toplevel bash ache/node/24.13.--show-toplevel git cjs --show-toplevel git de/node/bin/bash path.sh&#39; &#39;/usr/bgit git ache/node/24.13.--show-toplevel git (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 --get-regexp .cfg .cfg (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git p/TestGetNpmBinPnode _value&#34;].&#34;\n&#34;; ache/go/1.25.0/x64/pkg/tool/linu--show-toplevel git rev-�� ch ache/go/1.25.0/x64/pkg/tool/linu-v /usr/bin/git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel git /opt/hostedtoolc--noprofile git rev-�� --show-toplevel node /usr/bin/git install --package-lock-oname: /usr/bin/git git (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 --get-regexp .go ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 3927346/b088/vetjs/fuzz_mentions_harness.cjs ache/go/1.25.0/x64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linu-v /usr/bin/git se 3927346/b246/vetjs/fuzz_sanitize_label_harness.cjs ker/cli-plugins/docker-compose git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel x_amd64/compile /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel /opt/hostedtoolc-A /usr/bin/git git (http block)

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

Original prompt

Fix the failing GitHub Actions workflow Integration: Workflow Compiler
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 65170211310
Job URL: https://github.com/github/gh-aw/actions/runs/22495904943/job/65170211310


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 27, 2026 18:06
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…n SHAs

Fixes the failing 'Integration: Workflow Compiler' CI job (job 65170211310).

The recent commit updating action versions in action_pins.json changed the SHAs
for actions/setup-go, actions/setup-python, astral-sh/setup-uv, actions/setup-dotnet,
and actions/setup-java. Tests that hardcoded these SHAs started failing.

Replace all hardcoded SHA strings in runtime_integration_test.go and
runtime_setup_test.go with dynamic calls to GetActionPin(), so tests
remain valid when action versions are updated.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow Integration: Workflow Compiler fix: use GetActionPin dynamically in tests instead of hardcoded action SHAs Feb 27, 2026
@pelikhan pelikhan closed this Feb 28, 2026
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.

2 participants