Skip to content

Honor repositories: ["*"] in activation GitHub App token minting#45908

Merged
pelikhan merged 21 commits into
mainfrom
copilot/fix-build-activation-token-scope
Jul 16, 2026
Merged

Honor repositories: ["*"] in activation GitHub App token minting#45908
pelikhan merged 21 commits into
mainfrom
copilot/fix-build-activation-token-scope

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Activation GitHub App token minting did not honor the repositories: ["*"] sentinel. In reusable workflow_call flows, the activation job always scoped the token to github.event.repository.name, which broke cross-repo access needed to read the callee repo’s agent configuration.

  • Compiler behavior

    • Update buildActivationAppTokenMintStep to match the existing GitHub App token minting behavior used elsewhere:
      • omit repositories: when repositories: ["*"]
      • emit a single inline repository for one explicit repo
      • emit block-scalar form for multiple repos
      • fall back to github.event.repository.name only when no repositories are configured
  • Regression coverage

    • Add focused activation-job coverage asserting that the generated activation-app-token step does not include a repositories: input when the wildcard sentinel is configured
  • Behavioral effect

    • repositories: ["*"] now yields org-wide installation token scope for activation steps, instead of incorrectly forcing caller-repo scope
github-app:
  app-id: "12345"
  private-key: ${{ secrets.MY_PEM }}
  repositories: ["*"]

With this change, the generated activation token step omits:

with:
  repositories: ${{ github.event.repository.name }}

so the token can access any repository where the App is installed.

Copilot AI and others added 2 commits July 16, 2026 05:17
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix scope of token in buildActivationAppTokenMintStep Honor repositories: ["*"] in activation GitHub App token minting Jul 16, 2026
Copilot AI requested a review from pelikhan July 16, 2026 05:25
@pelikhan
pelikhan marked this pull request as ready for review July 16, 2026 05:26
Copilot AI review requested due to automatic review settings July 16, 2026 05:26
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update the safe outputs specification with w3c-spec-writer

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates activation GitHub App token minting to honor wildcard and explicit repository scopes.

Changes:

  • Omits repositories for ["*"], enabling installation-wide access.
  • Supports single, multiple, and default repository scopes.
  • Adds regression coverage and refreshes AWF v0.27.35 pins/workflows.
Show a summary per file
File Description
pkg/workflow/safe_outputs_app_config.go Implements activation repository scoping.
pkg/workflow/activation_github_token_test.go Tests wildcard omission.
pkg/workflow/data/action_pins.json Reorders AWF v0.27.35 pins.
pkg/actionpins/data/action_pins.json Mirrors updated pins.
.github/workflows/smoke-ci.lock.yml Regenerates with AWF v0.27.35.
.github/workflows/firewall.lock.yml Regenerates with AWF v0.27.35.
.github/workflows/example-permissions-warning.lock.yml Regenerates with AWF v0.27.35.
.github/workflows/daily-malicious-code-scan.lock.yml Regenerates with AWF v0.27.35.
.github/workflows/codex-github-remote-mcp-test.lock.yml Regenerates with AWF v0.27.35.
.github/workflows/bot-detection.lock.yml Regenerates with AWF v0.27.35.
.github/workflows/ai-moderator.lock.yml Regenerates with AWF v0.27.35.
.github/workflows/agentic-token-optimizer.lock.yml Regenerates with AWF v0.27.35.
.github/workflows/ace-editor.lock.yml Regenerates with AWF v0.27.35.

Review details

Tip

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

  • Files reviewed: 33/261 changed files
  • Comments generated: 0
  • Review effort level: Medium

Copilot AI and others added 3 commits July 16, 2026 05:32
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update the safe outputs specification with w3c-spec-writer

Addressed in 3d5f311. Updated the safe outputs specification with a new normative github-app.repositories section covering repositories: ["*"], activation and safe-output token minting, and workflow_call behavior, plus the spec metadata/changelog updates.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

…ivation-token-scope

# Conflicts:
#	.github/workflows/avenger.lock.yml
#	.github/workflows/hourly-ci-cleaner.lock.yml
#	.github/workflows/skillet.lock.yml

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Done — merged main and recompiled all 257 workflows successfully (9ae29dc). The only test failures (TestLogsJSONOutputWithNoRuns, TestCloseExistingOrgIssuesByMarkerSkipsPRsAndPaginates, TestRunWorkflowOnGitHub_FlagCombinations) are pre-existing on main and unrelated to this PR.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Done — merged main (401db81 - update all packages) and recompiled all 257 workflows (496c728).

@pelikhan

Copy link
Copy Markdown
Collaborator

Copilot AI and others added 2 commits July 16, 2026 08:38
…ter package update

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/github/gh-aw/actions/runs/29482462353/job/87569120370?pr=45908

Fixed in the latest commit. The CI failure was caused by the update all packages commit on main removing old container/action pins from action_pins.json. Updated test references across pkg/workflow and pkg/actionpins:

  • Firewall version 0.27.00.27.35 (in docker_firewall_pin_compile_test.go, awf_helpers_test.go, docker_pin_test.go)
  • Removed agent-act and build-tools assertions (these images are no longer in the embedded pin data)
  • actions/setup-node and actions/setup-go expected versions updated to v7.0.0
  • ghcr.io/github/gh-aw-mcpg references updated from v0.3.6/v0.3.9 to v0.4.1

All pkg/workflow and pkg/actionpins tests pass. The only remaining failures (TestLogsJSONOutputWithNoRuns, TestCloseExistingOrgIssuesByMarkerSkipsPRsAndPaginates, TestRunWorkflowOnGitHub_FlagCombinations) are pre-existing on main and unrelated to this PR.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Copilot AI and others added 2 commits July 16, 2026 10:07
…ivation-token-scope

# Conflicts:
#	pkg/actionpins/actionpins_internal_test.go
#	pkg/actionpins/spec_test.go
#	pkg/workflow/action_pins_test.go
#	pkg/workflow/awf_helpers_test.go
#	pkg/workflow/docker_firewall_pin_compile_test.go
#	pkg/workflow/docker_pin_test.go

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Done — merged main and recompiled all 257 workflows successfully (0 errors). Resolved test conflicts by adopting main's constants-based approach (constants.DefaultFirewallVersion, constants.DefaultMCPGatewayVersion) instead of hardcoded version strings.

@pelikhan
pelikhan merged commit 53ee208 into main Jul 16, 2026
29 checks passed
@pelikhan
pelikhan deleted the copilot/fix-build-activation-token-scope branch July 16, 2026 10:28
github-actions Bot added a commit that referenced this pull request Jul 16, 2026
Add GitHub App Repositories (github-app.repositories) term introduced
in commit 53ee208 (Honor `repositories: ["*"]` in activation GitHub
App token minting, #45908).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buildActivationAppTokenMintStep ignores  repositories: ["*"]  sentinel — always scopes token to github.event.repository.name

3 participants