Skip to content

Preserve valid GitHub App checkout token permissions when permissions.contents: none skips default checkout - #59743

Merged
pelikhan merged 6 commits into
mainfrom
copilot/fix-target-only-checkout-issue
Sep 9, 2026
Merged

pelikhan merged 6 commits into
mainfrom
copilot/fix-target-only-checkout-issue

Conversation

Copilot AI commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

permissions.contents: none correctly suppresses the workflow-repo default checkout, but it also propagated permission-contents: none into actions/create-github-app-token for explicit target checkouts. That makes token minting invalid for GitHub App installs and breaks target-only checkout flows.

  • Permission resolution for checkout app-token minting

    • Added a checkout-specific permission resolver that guarantees contents: read minimum when minting checkout GitHub App tokens.
    • Scope is limited to checkout token minting; it does not change the existing behavior that uses permissions.contents: none to skip default checkout.
  • Compiler wiring update

    • Switched checkout app-token generation to use the new resolver in agent-job checkout step generation.
  • Regression coverage

    • Added an integration test for target-only checkout with explicit github-app and workflow-level permissions.contents: none, asserting:
      • default checkout remains skipped
      • target checkout remains present
      • minted token uses permission-contents: read (not none)
permissions:
  contents: none

checkout:
  - repository: octo-org/target-repository
    path: target
    github-app:
      client-id: ${{ vars.TARGET_APP_CLIENT_ID }}
      private-key: ${{ secrets.TARGET_APP_PRIVATE_KEY }}
      owner: octo-org
      repositories:
        - target-repository

Run: https://github.com/github/gh-aw/actions/runs/34390852001

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 17.8 AIC · ⌖ 7.1 AIC · ⊞ 9.3K · ◷
Comment /souschef to run again

Copilot AI changed the title [WIP] Fix regression with target-only checkout for GitHub App Preserve valid GitHub App checkout token permissions when permissions.contents: none skips default checkout Sep 9, 2026
Copilot AI requested a review from pelikhan September 9, 2026 14:40
@pelikhan
pelikhan marked this pull request as ready for review September 9, 2026 14:42
Copilot AI balanced review requested due to automatic review settings September 9, 2026 14:42

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.

🟡 Changes recommended

Safe-output checkouts remain broken, skipped default checkouts can mint unnecessary tokens, and unrelated lockfile drift should be removed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes target-only GitHub App checkouts by requesting contents: read while still suppressing the default checkout.

Changes:

  • Adds checkout-specific permission resolution and regression coverage.
  • Regenerates 12 workflow locks with unrelated gpt-6 routing changes.
File summaries
File Description
pkg/workflow/compiler_yaml_checkout.go Adjusts checkout App-token permissions.
pkg/workflow/checkout_disabled_test.go Tests target-only App checkout behavior.
.github/workflows/windows.lock.yml Adds generated gpt-6 routing.
.github/workflows/windows-grower.lock.yml Adds generated gpt-6 routing.
.github/workflows/semantic-function-refactor.lock.yml Adds generated gpt-6 routing.
.github/workflows/notion-issue-summary.lock.yml Adds generated gpt-6 routing.
.github/workflows/hippo-embed.lock.yml Adds generated gpt-6 routing.
.github/workflows/firewall.lock.yml Adds generated gpt-6 routing.
.github/workflows/example-permissions-warning.lock.yml Adds generated gpt-6 routing.
.github/workflows/daily-max-ai-credits-test.lock.yml Adds generated gpt-6 routing.
.github/workflows/daily-harness-experiment-proposer.lock.yml Adds generated gpt-6 routing.
.github/workflows/daily-credit-limit-test.lock.yml Adds generated gpt-6 routing.
.github/workflows/codex-github-remote-mcp-test.lock.yml Adds generated gpt-6 routing.
.github/workflows/agentic-token-optimizer.lock.yml Adds generated gpt-6 routing.
Review details
  • Files reviewed: 30/299 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread pkg/workflow/compiler_yaml_checkout.go Outdated
Comment on lines +128 to +131
// resolveCheckoutAppTokenPermissions returns permissions for checkout GitHub App token minting.
// Explicit target checkouts still need repository contents access, even when
// permissions.contents is set to none to suppress the default workflow checkout.
func resolveCheckoutAppTokenPermissions(data *WorkflowData) *Permissions {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in bf54249: resolveCheckoutAppTokenPermissions moved next to resolveCheckoutPermissions in checkout_manager.go and is now used by both callers — the agent job (compiler_yaml_checkout.go) and the safe_outputs job (compiler_safe_outputs_steps.go, both the github-app and safe-outputs-github-app mint paths).

(umask 177 && touch /tmp/gh-aw/agent-stdio.log)
# shellcheck disable=SC2016
printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.28.14/awf-config.schema.json","network":{"allowDomains":["api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","s.symcb.com","s.symcd.com","security.ubuntu.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"],"isolation":true,"topologyAttach":["awmg-mcpg","awmg-cli-proxy"]},"apiProxy":{"enabled":true,"enableTokenSteering":true,"maxRuns":500,"maxCacheMisses":5,"maxAiCredits":1500,"models":{"agent":["sonnet-6x","gpt-5.4","gpt-5.5","gpt-5.6","gpt-5.3","gemini-pro","any"],"antigravity":["copilot/antigravity*","google/antigravity*","gemini/antigravity*"],"any":["copilot/*","anthropic/*","openai/*","google/*","gemini/*"],"auto":["copilot/auto","large"],"claude":["agent"],"codex":["agent"],"coding":["copilot/gpt-5*codex*","openai/gpt-5*codex*","gpt-5-codex","kimi"],"computer-use":["copilot/*computer-use*","google/*computer-use*","gemini/*computer-use*","openai/*computer-use*"],"copilot":["agent"],"deep-research":["copilot/deep-research*","copilot/o3-deep-research*","copilot/o4-mini-deep-research*","google/deep-research*","gemini/deep-research*","openai/o3-deep-research*","openai/o4-mini-deep-research*"],"detection":["small"],"evals":["small"],"fable":["copilot/*fable*","anthropic/*fable*"],"gemini":["agent"],"gemini-3-flash":["copilot/gemini-3*flash*","google/gemini-3*flash*","gemini/gemini-3*flash*"],"gemini-3-pro":["copilot/gemini-3*pro*","google/gemini-3*pro*","google/nano-banana*","gemini/gemini-3*pro*"],"gemini-3.1-flash":["copilot/gemini-3.1*flash*","google/gemini-3.1*flash*","gemini/gemini-3.1*flash*"],"gemini-3.1-pro":["copilot/gemini-3.1*pro*","google/gemini-3.1*pro*","gemini/gemini-3.1*pro*"],"gemini-3.5-flash":["copilot/gemini-3.5*flash*","google/gemini-3.5*flash*","gemini/gemini-3.5*flash*"],"gemini-3.6-flash":["copilot/gemini-3.6*flash*","google/gemini-3.6*flash*","gemini/gemini-3.6*flash*"],"gemini-3.7-flash":["copilot/gemini-3.7*flash*","google/gemini-3.7*flash*","gemini/gemini-3.7*flash*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*","gemini/gemini-*flash*"],"gemini-flash-lite":["copilot/gemini-*flash*lite*","google/gemini-*flash*lite*","gemini/gemini-*flash*lite*"],"gemini-omni":["copilot/gemini-omni*","google/gemini-omni*","gemini/gemini-omni*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*","gemini/gemini-*pro*"],"gemma":["copilot/gemma*","google/gemma*","gemini/gemma*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"gpt-5.1":["copilot/gpt-5.1*","openai/gpt-5.1*"],"gpt-5.2":["copilot/gpt-5.2*","openai/gpt-5.2*"],"gpt-5.3":["copilot/gpt-5.3*","openai/gpt-5.3*"],"gpt-5.4":["copilot/gpt-5.4*","openai/gpt-5.4*"],"gpt-5.5":["copilot/gpt-5.5*","openai/gpt-5.5*"],"gpt-5.6":["copilot/gpt-5.6*","openai/gpt-5.6*"],"grok":["copilot/*grok*","openai/*grok*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"image-generation":["copilot/gpt-image*","openai/gpt-image*","openai/chatgpt-image*","copilot/gemini-*image*","google/gemini-*image*","gemini/gemini-*image*","google/imagen*"],"kimi":["copilot/kimi*","openai/kimi*"],"kiwi":["copilot/kiwi*","openai/kiwi*"],"large":["sonnet","gpt-5-pro","gpt-5","gemini-pro"],"lyria":["google/lyria*","gemini/lyria*","copilot/lyria*"],"mai-code":["copilot/MAI-Code*","copilot/mai-code*","openai/MAI-Code*"],"mai-code-1-flash-picker":["copilot/MAI-Code-1-Flash-picker*","copilot/mai-code-1-flash-picker*","openai/MAI-Code-1-Flash-picker*"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash-lite"],"nano-banana":["copilot/nano-banana*","google/nano-banana*","gemini/nano-banana*"],"opus":["copilot/*opus*","anthropic/*opus*"],"opusplan":["opus?effort=high"],"raptor-mini":["copilot/raptor*","openai/raptor*"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"robotics":["copilot/*robotics*","google/*robotics*","gemini/*robotics*"],"small":["mini"],"small-agent":["haiku","gpt-5-mini","gemini-flash"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"],"sonnet-6x":["copilot/*sonnet-4.5*","copilot/*sonnet-4.6*","copilot/*sonnet-5*","copilot/*sonnet-4-5-*","anthropic/*sonnet-4-5-*","copilot/*sonnet-4-6*","anthropic/*sonnet-4-6*","anthropic/*sonnet-5*"],"summarization":["haiku","gpt-5-mini","gemini-flash-lite","mini"],"veo":["google/veo*","gemini/veo*"],"vision":["copilot/gemini-*image*","google/gemini-*image*","gemini/gemini-*image*","copilot/gemini-*flash*","google/gemini-*flash*","gemini/gemini-*flash*"]}},"container":{"imageTag":"0.28.14,squid=sha256:2ce8df3abf3e9b76e9c0cf5863da41f1ab3f89b20ad14b988806ab89e7bf2cd5,agent=sha256:f7df036c86575527b61f3f7df91c4412349a12b2a74988d929eafa2999230c98,api-proxy=sha256:6f95e2234dd9bd6333a8ff28ccea7ecf0204acd4a09108723844dbd2bf6268c5,cli-proxy=sha256:3a379c5e96e29499c815e9dd2a71334d01c326a9b73991c76544fda9cae35c34"},"logging":{"proxyLogsDir":"/tmp/gh-aw/sandbox/firewall/logs","auditDir":"/tmp/gh-aw/sandbox/firewall/audit"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json"
printf '%s\n' '{"$schema":"https://github.com/github/gh-aw-firewall/releases/download/v0.28.14/awf-config.schema.json","network":{"allowDomains":["api.snapcraft.io","archive.ubuntu.com","azure.archive.ubuntu.com","crl.geotrust.com","crl.globalsign.com","crl.identrust.com","crl.sectigo.com","crl.thawte.com","crl.usertrust.com","crl.verisign.com","crl3.digicert.com","crl4.digicert.com","crls.ssl.com","json-schema.org","json.schemastore.org","keyserver.ubuntu.com","ocsp.digicert.com","ocsp.geotrust.com","ocsp.globalsign.com","ocsp.identrust.com","ocsp.sectigo.com","ocsp.ssl.com","ocsp.thawte.com","ocsp.usertrust.com","ocsp.verisign.com","packagecloud.io","packages.cloud.google.com","packages.microsoft.com","ppa.launchpad.net","s.symcb.com","s.symcd.com","security.ubuntu.com","ts-crl.ws.symantec.com","ts-ocsp.ws.symantec.com","www.googleapis.com"],"isolation":true,"topologyAttach":["awmg-mcpg","awmg-cli-proxy"]},"apiProxy":{"enabled":true,"enableTokenSteering":true,"maxRuns":500,"maxCacheMisses":5,"maxAiCredits":1500,"models":{"agent":["sonnet-6x","gpt-6","gpt-5.4","gpt-5.5","gpt-5.6","gpt-5.3","gemini-pro","any"],"antigravity":["copilot/antigravity*","google/antigravity*","gemini/antigravity*"],"any":["copilot/*","anthropic/*","openai/*","google/*","gemini/*"],"auto":["copilot/auto","large"],"claude":["agent"],"codex":["agent"],"coding":["copilot/gpt-5*codex*","openai/gpt-5*codex*","gpt-5-codex","kimi"],"computer-use":["copilot/*computer-use*","google/*computer-use*","gemini/*computer-use*","openai/*computer-use*"],"copilot":["agent"],"deep-research":["copilot/deep-research*","copilot/o3-deep-research*","copilot/o4-mini-deep-research*","google/deep-research*","gemini/deep-research*","openai/o3-deep-research*","openai/o4-mini-deep-research*"],"detection":["small"],"evals":["small"],"fable":["copilot/*fable*","anthropic/*fable*"],"gemini":["agent"],"gemini-3-flash":["copilot/gemini-3*flash*","google/gemini-3*flash*","gemini/gemini-3*flash*"],"gemini-3-pro":["copilot/gemini-3*pro*","google/gemini-3*pro*","google/nano-banana*","gemini/gemini-3*pro*"],"gemini-3.1-flash":["copilot/gemini-3.1*flash*","google/gemini-3.1*flash*","gemini/gemini-3.1*flash*"],"gemini-3.1-pro":["copilot/gemini-3.1*pro*","google/gemini-3.1*pro*","gemini/gemini-3.1*pro*"],"gemini-3.5-flash":["copilot/gemini-3.5*flash*","google/gemini-3.5*flash*","gemini/gemini-3.5*flash*"],"gemini-3.6-flash":["copilot/gemini-3.6*flash*","google/gemini-3.6*flash*","gemini/gemini-3.6*flash*"],"gemini-3.7-flash":["copilot/gemini-3.7*flash*","google/gemini-3.7*flash*","gemini/gemini-3.7*flash*"],"gemini-flash":["copilot/gemini-*flash*","google/gemini-*flash*","gemini/gemini-*flash*"],"gemini-flash-lite":["copilot/gemini-*flash*lite*","google/gemini-*flash*lite*","gemini/gemini-*flash*lite*"],"gemini-omni":["copilot/gemini-omni*","google/gemini-omni*","gemini/gemini-omni*"],"gemini-pro":["copilot/gemini-*pro*","google/gemini-*pro*","gemini/gemini-*pro*"],"gemma":["copilot/gemma*","google/gemma*","gemini/gemma*"],"gpt-5":["copilot/gpt-5*","openai/gpt-5*"],"gpt-5-codex":["copilot/gpt-5*codex*","openai/gpt-5*codex*"],"gpt-5-mini":["copilot/gpt-5*mini*","openai/gpt-5*mini*"],"gpt-5-nano":["copilot/gpt-5*nano*","openai/gpt-5*nano*"],"gpt-5-pro":["copilot/gpt-5*pro*","openai/gpt-5*pro*"],"gpt-5.1":["copilot/gpt-5.1*","openai/gpt-5.1*"],"gpt-5.2":["copilot/gpt-5.2*","openai/gpt-5.2*"],"gpt-5.3":["copilot/gpt-5.3*","openai/gpt-5.3*"],"gpt-5.4":["copilot/gpt-5.4*","openai/gpt-5.4*"],"gpt-5.5":["copilot/gpt-5.5*","openai/gpt-5.5*"],"gpt-5.6":["copilot/gpt-5.6*","openai/gpt-5.6*"],"gpt-6":["copilot/gpt-6*","openai/gpt-6*"],"grok":["copilot/*grok*","openai/*grok*"],"haiku":["copilot/*haiku*","anthropic/*haiku*"],"image-generation":["copilot/gpt-image*","openai/gpt-image*","openai/chatgpt-image*","copilot/gemini-*image*","google/gemini-*image*","gemini/gemini-*image*","google/imagen*"],"kimi":["copilot/kimi*","openai/kimi*"],"kiwi":["copilot/kiwi*","openai/kiwi*"],"large":["sonnet","gpt-6","gpt-5-pro","gpt-5","gemini-pro"],"lyria":["google/lyria*","gemini/lyria*","copilot/lyria*"],"mai-code":["copilot/MAI-Code*","copilot/mai-code*","openai/MAI-Code*"],"mai-code-1-flash-picker":["copilot/MAI-Code-1-Flash-picker*","copilot/mai-code-1-flash-picker*","openai/MAI-Code-1-Flash-picker*"],"mini":["haiku","gpt-5-mini","gpt-5-nano","gemini-flash-lite"],"nano-banana":["copilot/nano-banana*","google/nano-banana*","gemini/nano-banana*"],"opus":["copilot/*opus*","anthropic/*opus*"],"opusplan":["opus?effort=high"],"raptor-mini":["copilot/raptor*","openai/raptor*"],"reasoning":["copilot/o1*","copilot/o3*","copilot/o4*","openai/o1*","openai/o3*","openai/o4*"],"robotics":["copilot/*robotics*","google/*robotics*","gemini/*robotics*"],"small":["mini"],"small-agent":["haiku","gpt-5-mini","gemini-flash"],"sonnet":["copilot/*sonnet*","anthropic/*sonnet*"],"sonnet-6x":["copilot/*sonnet-4.5*","copilot/*sonnet-4.6*","copilot/*sonnet-5*","copilot/*sonnet-4-5-*","anthropic/*sonnet-4-5-*","copilot/*sonnet-4-6*","anthropic/*sonnet-4-6*","anthropic/*sonnet-5*"],"summarization":["haiku","gpt-5-mini","gemini-flash-lite","mini"],"veo":["google/veo*","gemini/veo*"],"vision":["copilot/gemini-*image*","google/gemini-*image*","gemini/gemini-*image*","copilot/gemini-*flash*","google/gemini-*flash*","gemini/gemini-*flash*"]}},"container":{"imageTag":"0.28.14,squid=sha256:2ce8df3abf3e9b76e9c0cf5863da41f1ab3f89b20ad14b988806ab89e7bf2cd5,agent=sha256:f7df036c86575527b61f3f7df91c4412349a12b2a74988d929eafa2999230c98,api-proxy=sha256:6f95e2234dd9bd6333a8ff28ccea7ecf0204acd4a09108723844dbd2bf6268c5,cli-proxy=sha256:3a379c5e96e29499c815e9dd2a71334d01c326a9b73991c76544fda9cae35c34"},"logging":{"proxyLogsDir":"/tmp/gh-aw/sandbox/firewall/logs","auditDir":"/tmp/gh-aw/sandbox/firewall/audit"}}' > "${RUNNER_TEMP}/gh-aw/awf-config.json"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in bf54249: all .github/workflows/*.lock.yml files are reverted to the base commit, so this PR contains only the Go changes and tests. No repository workflow uses checkout app auth, so the compiler change produces no lock-file changes.

Comment on lines 94 to +96
if checkoutMgr.HasAppAuth() {
compilerYamlLog.Print("Generating checkout app token minting steps in agent job")
for _, step := range checkoutMgr.GenerateCheckoutAppTokenSteps(c, resolveCheckoutPermissions(data)) {
for _, step := range checkoutMgr.GenerateCheckoutAppTokenSteps(c, resolveCheckoutAppTokenPermissions(data)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in bf54249: CheckoutManager.SetSkipDefaultCheckout is set from !needsCheckout (agent job) and data.CheckoutSkipDefault (safe_outputs job), and both app-token generators skip the default entry when it is suppressed, so no unused contents: read token is minted. Target entries are unaffected and the regression test asserts checkout-app-token-0 is absent while checkout-app-token-1 is present.

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #59743

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-09-09T15:21:02.084+00:00
review_event: REQUEST_CHANGES
top_themes:
- safe_outputs checkout app-token permissions still use the old resolver
- regression test only covers the agent job path
files_reviewed:
- pkg/workflow/compiler_yaml_checkout.go
- pkg/workflow/checkout_disabled_test.go
comment_count: 1

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 60.1 AIC · ⌖ 5.69 AIC · ⊞ 22.9K · ◷
Comment /review to run again

@github-actions github-actions Bot 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.

Request changes

The agent-job path is fixed, but the matching safe_outputs checkout path still uses the old permission resolver, so target-only PR/push workflows with checkout GitHub App auth can still fail.

Blocking theme

The new regression coverage only inspects the agent job, which means it will not catch the still-broken safe_outputs path that mirrors checkout token minting for PR operations.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 60.1 AIC · ⌖ 5.69 AIC · ⊞ 22.9K
Comment /review to run again

require.NoError(t, err, "should read lock file")
lockContentStr := string(lockContent)

agentJobStart := strings.Index(lockContentStr, "\n agent:")

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.

This test only inspects the agent section, so it will still pass while the mirrored safe_outputs checkout path keeps emitting permission-contents: none and breaking PR/push flows.

💡 Why this is still broken

generateAppTokenAndDefaultCheckoutSteps now calls resolveCheckoutAppTokenPermissions, but buildSharedPRCheckoutSteps still passes resolveCheckoutPermissions(data) to both checkout app-token generators. That leaves the safe-outputs create-pull-request / push-to-pull-request-branch path on the old behavior, which is exactly the path that needs a valid checkout token for target-only cross-repo operations.

A tighter regression test here should also assert the compiled safe_outputs job requests permission-contents: read for these tokens; otherwise this test will stay green while the write path is still broken.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in bf54249: buildSharedPRCheckoutSteps now mints both checkout-app-token-* and checkout-safe-output-app-token-* with resolveCheckoutAppTokenPermissions, and a new regression test (TestCheckoutDisabledWithSafeOutputsAppTargetUsesContentsReadForMintedToken) compiles a target-only workflow with create-pull-request and asserts permission-contents: read in the safe_outputs job.

@github-actions github-actions Bot 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.

Reviewed with Impeccable harden/audit modes (bug-fix category: checkout permission resolution for GitHub App token minting).

The two substantive gaps in this fix are already flagged by existing Copilot review comments on this PR and remain unaddressed as of this review:

  • resolveCheckoutAppTokenPermissions is only wired into the agent-job caller (compiler_yaml_checkout.go:96); buildSharedPRCheckoutSteps in compiler_safe_outputs_steps.go still calls the unfixed resolveCheckoutPermissions for the same token-minting generator, so the same regression persists for the safe_outputs job path (comment on line 131).
  • The elevation to contents: read is applied unconditionally to every app-authenticated checkout entry, including ones that back the (skipped) default checkout, rather than only entries needed for needsCheckout-independent target checkouts (comment on line 96).

No new actionable issues found beyond what's already tracked in the open review thread.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • api.github.com
  • github.com

[!TIP]
api.github.com is blocked because GitHub API access uses the built-in GitHub tools by default. Instead of adding api.github.com to network.allowed, use tools.github.mode: gh-proxy for direct pre-authenticated GitHub CLI access without requiring network access to api.github.com:

tools:
  github:
    mode: gh-proxy

See GitHub Tools for more information on gh-proxy mode.

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.github.com"
    - "github.com"

See Network Configuration for more information.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 126.7 AIC · ⌖ 13.6 AIC · ⊞ 8.4K

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs — requesting changes: the root cause is only partially fixed.

📋 Key Themes & Highlights

Key Themes

  • Root-cause fix is scoped to one of two call sites. The bug (permissions.contents: none leaking into actions/create-github-app-token for checkout tokens) is fixed for the agent job (generateAppTokenAndDefaultCheckoutSteps in compiler_yaml_checkout.go) but the same CheckoutManager generators are reused by buildSharedPRCheckoutSteps in compiler_safe_outputs_steps.go, which still calls the un-elevated resolveCheckoutPermissions. Any workflow combining permissions.contents: none, a github-app-authenticated checkout, and a create_pull_request/push_to_pull_request_branch safe output will still mint an invalid permission-contents: none token — in the safe_outputs job instead of the agent job. This is a regression-fix PR, so per /diagnosing-bugs the fix should cover every path that reaches the buggy behavior, not just the one exercised by the new test.
  • Regression test only covers the agent job. TestCheckoutDisabledWithGitHubAppTargetUsesContentsReadForMintedToken is a solid, well-structured regression test, but it doesn't reach buildSharedPRCheckoutSteps/compiler_safe_outputs_steps.go, so the gap above has no test coverage and would ship silently.
  • Existing Copilot review comments on this PR (lines 96 and 131 of compiler_yaml_checkout.go) already flag closely related concerns — worth resolving together.

Positive Highlights

  • ✅ resolveCheckoutAppTokenPermissions is a clean, minimal, well-documented wrapper that keeps the "none skips default checkout" behavior separate from "minted tokens need contents:read" — good separation of concerns.
  • ✅ The new regression test asserts both directions (permission-contents: read present, permission-contents: none absent) and checks the target checkout is still emitted — good test shape for a regression fix.

@copilot please address the review comments above.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 213.9 AIC · ⌖ 15.2 AIC · ⊞ 10.4K
Comment /matt to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please address the outstanding review feedback before running the pr-finisher skill.

Outstanding unresolved review threads:

Please also refresh the branch if needed and then run the pr-finisher skill after the review threads are addressed.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 25.7 AIC · ⌖ 7.32 AIC · ⊞ 9.1K · ◷
Comment /souschef to run again

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Category: bug | Risk: medium | Score: 62/100 (impact 32/50, urgency 17/30, quality 13/20) | Action: batch_review | Reason: focused checkout permission fix with good regression coverage; best handled as part of the auth/checkout batch.

Generated by 🔧 PR Triage Agent · copilot · mai10 · 15.7 AIC · ⌖ 2.67 AIC · ⊞ 18.8K · ◷

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please address the remaining review feedback, refresh the branch if needed, and then run the pr-finisher skill.

Outstanding review feedback:

  • 🟡 Changes recommended

  • Request changes

  • Reviewed with Impeccable harden/audit modes (bug-fix category: checkout permission resolution for GitHub App token minting).

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 17.8 AIC · ⌖ 7.1 AIC · ⊞ 9.3K · ◷
Comment /souschef to run again

Copilot AI commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please address the remaining review feedback, refresh the branch if needed, and then run the pr-finisher skill.

Outstanding review feedback:...

Ran pr-finisher. All listed review feedback was already addressed in bf54249 — the "Changes recommended", "Request changes", and Impeccable harden/audit reviews were all submitted against 30a0dc3 and raise the same three points:

  1. safe_outputs resolver — buildSharedPRCheckoutSteps now passes resolveCheckoutAppTokenPermissions to both GenerateCheckoutAppTokenSteps and GenerateSafeOutputCheckoutAppTokenSteps (compiler_safe_outputs_steps.go:73,76), alongside the agent job (compiler_yaml_checkout.go:101).
  2. Unconditional elevation — SetSkipDefaultCheckout is set from !needsCheckout (agent) and data.CheckoutSkipDefault (safe_outputs), so the suppressed default entry mints no token; target entries are unaffected.
  3. Lockfile drift — all .lock.yml files reverted; the PR diff vs main is 5 files (+182/−4) with no generated drift, and make recompile reproduces all 299 lock files unchanged.

Branch is already up to date (a20b39e merges main @ 730d6b0, no conflicts). Local validation on the merged HEAD is green: make fmt, make lint (0 errors), make test-unit, full ./pkg/workflow/... suite, and make recompile. Prior CI at c08a809 (same code content) passed CGO + CWI; runs on a20b39e are action_required, i.e. awaiting maintainer approval rather than failing.

Two hand-offs I can't do from here: the four review threads still show unresolved (I can reply but have no thread-resolve permission), and CI needs a maintainer re-trigger since agent pushes don't start workflows. Not merging, per skill rules.

@pelikhan
pelikhan merged commit 0a2eefa into main Sep 9, 2026
33 checks passed
@pelikhan
pelikhan deleted the copilot/fix-target-only-checkout-issue branch September 9, 2026 20:05
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.89.1

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.

Regression with target-only checkout failing with explicit GitHub App checkout

4 participants