diff --git a/.github/workflows/copilot-token-audit.lock.yml b/.github/workflows/copilot-token-audit.lock.yml index 3ea303d2c48..42090bfc8b4 100644 --- a/.github/workflows/copilot-token-audit.lock.yml +++ b/.github/workflows/copilot-token-audit.lock.yml @@ -438,6 +438,8 @@ jobs: gh extension remove gh-aw || true gh extension install . gh aw version + env: + GH_TOKEN: ${{ github.token }} - name: Setup Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: diff --git a/.github/workflows/copilot-token-optimizer.lock.yml b/.github/workflows/copilot-token-optimizer.lock.yml index 4a56e5bdb1d..95a6633f859 100644 --- a/.github/workflows/copilot-token-optimizer.lock.yml +++ b/.github/workflows/copilot-token-optimizer.lock.yml @@ -407,6 +407,8 @@ jobs: gh extension remove gh-aw || true gh extension install . gh aw version + env: + GH_TOKEN: ${{ github.token }} - name: Create gh-aw temp directory run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh" - name: Configure gh CLI for GitHub Enterprise diff --git a/.github/workflows/static-analysis-report.lock.yml b/.github/workflows/static-analysis-report.lock.yml index 9569d6f1c1c..a97c4d1fc20 100644 --- a/.github/workflows/static-analysis-report.lock.yml +++ b/.github/workflows/static-analysis-report.lock.yml @@ -443,6 +443,8 @@ jobs: gh extension remove gh-aw || true gh extension install . gh aw version + env: + GH_TOKEN: ${{ github.token }} - name: Create gh-aw temp directory run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh" - name: Configure gh CLI for GitHub Enterprise diff --git a/pkg/workflow/runtime_gh_aw_test.go b/pkg/workflow/runtime_gh_aw_test.go index c69413cb958..67f7a7f0c52 100644 --- a/pkg/workflow/runtime_gh_aw_test.go +++ b/pkg/workflow/runtime_gh_aw_test.go @@ -112,6 +112,7 @@ func TestGenerateRuntimeSetupSteps_GhAw_DevBuildsFromSource(t *testing.T) { assert.Contains(t, content, "gh extension remove gh-aw || true") assert.Contains(t, content, "gh extension install .") assert.Contains(t, content, "gh aw version") + assert.Contains(t, content, "GH_TOKEN: ${{ github.token }}") assert.NotContains(t, content, "github/gh-aw/actions/setup-cli@") } diff --git a/pkg/workflow/runtime_step_generator.go b/pkg/workflow/runtime_step_generator.go index c0a513c22c0..85323a11273 100644 --- a/pkg/workflow/runtime_step_generator.go +++ b/pkg/workflow/runtime_step_generator.go @@ -68,6 +68,8 @@ func generateSetupStep(req *RuntimeRequirement) GitHubActionStep { " gh extension remove gh-aw || true", " gh extension install .", " gh aw version", + " env:", + " GH_TOKEN: ${{ github.token }}", ) return step }