Skip to content

Relax approval gating for low-risk PR automations - #53480

Closed
pelikhan with Copilot wants to merge 8 commits into
mainfrom
copilot/copilot-opt-investigate-high-action-required-rate
Closed

Relax approval gating for low-risk PR automations#53480
pelikhan with Copilot wants to merge 8 commits into
mainfrom
copilot/copilot-opt-investigate-high-action-required-rate

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Several automation workflows were entering action_required before any job ran, blocking routine safe-output updates and obscuring run history. The affected runs were PR-triggered automations where the approval gate fired before branch-skip conditions could evaluate.

  • Use target-context PR triggers

    • Move the affected PR-close automations to pull_request_target.
    • Generate Agentic Commands PR routing with pull_request_target so same-repo automation events do not stall before dispatch.
  • Keep routing semantics stable

    • Normalize pull_request_target back to pull_request inside the central router so existing route metadata continues to match.
    • Preserve current workflow dispatch behavior and route configuration shape.
  • Avoid untrusted head checkout

    • Pin PR Description Updater checkout to the trusted base repo/base SHA while keeping full history available for diff generation.
on:
  pull_request_target:
    types: [closed]

checkout:
  repository: ${{ github.repository }}
  ref: ${{ github.event.pull_request.base.sha }}
  fetch-depth: 0

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 4.94 AIC · ⌖ 7.85 AIC · ⊞ 8.8K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/32076538787> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.2 AIC · ⌖ 7.86 AIC · ⊞ 8.8K ·

Comment /souschef to run again

Copilot AI and others added 2 commits August 17, 2026 20:34
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] Investigate high action required rate in automation workflows Relax approval gating for low-risk PR automations Aug 17, 2026
Copilot AI requested a review from pelikhan August 17, 2026 20:43
@pelikhan
pelikhan marked this pull request as ready for review August 17, 2026 20:44
Copilot AI balanced review requested due to automatic review settings August 17, 2026 20:44

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 PR automations to avoid approval-gated runs while preserving trusted checkout and routing behavior.

Changes:

  • Uses pull_request_target for affected workflows.
  • Normalizes target events for centralized routing.
  • Checks out trusted base history for PR description generation.
Show a summary per file
File Description
pkg/workflow/central_slash_command_workflow.go Generates target-context PR triggers.
pkg/workflow/central_slash_command_workflow_test.go Updates trigger-generation assertions.
actions/setup/js/route_slash_command.cjs Normalizes target events during routing.
actions/setup/js/route_slash_command.test.cjs Tests target-event dispatch.
.github/workflows/pr-description-caveman.md Uses a trusted base checkout.
.github/workflows/pr-description-caveman.lock.yml Regenerates the compiled workflow.
.github/workflows/label-closed-prs.yml Moves closure labeling to target context.
.github/workflows/agentic_commands.yml Updates generated command routing trigger.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment on lines +46 to +47
if (context.eventName === "pull_request_target") {
return "pull_request";

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 b6a2da5: both dispatch paths now override event_type with the normalized identifier before serializing aw_context, and the pull_request_target test asserts awContext.event_type === "pull_request".

checkout:
repository: ${{ github.repository }}
ref: ${{ github.event.pull_request.base.sha }}
fetch-depth: 0

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 b6a2da5: added an explicit git fetch origin "refs/pull/${PR_NUMBER}/head:refs/gh-aw/pr-${PR_NUMBER}/head" before the diff commands so the fork's head commit is present locally without checking it out.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — this PR looks great! You've addressed the approval gating stall by converting low-risk automations to pull_request_target while keeping routing semantics stable through normalization in the routing layer. The changes are well-focused and include thorough test coverage:

What's working here:

  • Clean separation of concerns: workflow event changes paired with routing normalization
  • Comprehensive routing layer updates (JS route_slash_command and Go central workflow generator both handle the translation)
  • Added test coverage that validates pull_request_target events normalize to pull_request routes
  • Minimal, surgical diff with clear intent (71 additions, 41 deletions across 8 files)
  • Proper checkout configuration on PR base SHA with full history available for diff generation
  • Issue [copilot-opt] Investigate high action_required rate blocking automation workflows #53449 is referenced, showing proper linkage

The PR is ready for review and merge!

Generated by ✅ Contribution Check · auto · 57.2 AIC · ⌖ 5.09 AIC · ⊞ 9.2K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot PR sous-chef triage: branch refresh was requested. Please investigate the current UNSTABLE state, re-run the pr-finisher skill, and report any remaining blockers on this PR.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 4.94 AIC · ⌖ 7.85 AIC · ⊞ 8.8K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot PR sous-chef triage: branch refresh was requested. Please investigate the current UNSTABLE state, re-run the pr-finisher skill, and report any remaining blockers on this PR.

Generated ...

Investigated the UNSTABLE state: the branch had an out-of-date generated agentic_commands.yml lock file after merging main (the "squad" slash-command route added upstream wasn't reflected in the compiled routing map). Recompiled and pushed in 3aa5e2c-equivalent commit; make agent-report-progress-no-test now passes cleanly (lint, format, schema freshness, workflow lock sync all green). No other blockers found — the copilot check is currently in progress.

Copilot AI requested a review from gh-aw-bot August 17, 2026 21:16
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot PR sous-chef triage: branch refresh was requested. Please run the pr-finisher skill and report any remaining blockers on this PR.

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

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 5.68 AIC · ⌖ 12.7 AIC · ⊞ 8.8K ·
Comment /souschef to run again

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot PR sous-chef triage: branch refresh was requested. Please run the pr-finisher skill and report any remaining blockers on this PR.

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

Re-verified the branch: working tree is clean, agentic_commands.yml is in sync with source, and make agent-report-progress-no-test passes cleanly (Go/JS lint, format, schema freshness, workflow lock sync). No new blockers found — the copilot check run is currently in progress; mergeable_state: blocked reflects pending review approval, not a code or CI issue.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please address these unresolved review threads (newest first):

Please refresh the branch if needed and run the pr-finisher skill.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.2 AIC · ⌖ 7.86 AIC · ⊞ 8.8K ·
Comment /souschef to run again

… PR head ref before diffing

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please address these unresolved review threads (newest first):

Addressed both threads in b6a2da5: event_type is now overridden with the normalized identifier in the dispatched aw_context, and the PR description updater explicitly fetches the fork PR's head ref before diffing. Tests pass (54/54 in route_slash_command.test.cjs) and lock files are recompiled.

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.

[copilot-opt] Investigate high action_required rate blocking automation workflows

4 participants