Skip to content

Commit 7d8ad7f

Browse files
authored
Merge pull request #412 from githubnext/codex/evergreen-avoid-pr-activation
Avoid PR-event Evergreen activation
2 parents 7c5ea99 + 746b69e commit 7d8ad7f

3 files changed

Lines changed: 33 additions & 41 deletions

File tree

.github/workflows/evergreen.lock.yml

Lines changed: 15 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/evergreen.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
---
22
on:
3-
pull_request:
4-
types: [labeled, synchronize, reopened, ready_for_review]
53
push:
64
branches: [main]
75
schedule:
@@ -54,7 +52,8 @@ jobs:
5452
name: Evaluate PR gate state
5553
shell: bash
5654
env:
57-
GH_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN || github.token }}
55+
GH_TOKEN: ${{ github.token }}
56+
CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN || '' }}
5857
REPO: ${{ github.repository }}
5958
EVENT_NAME: ${{ github.event_name }}
6059
EVENT_ACTION: ${{ github.event.action }}
@@ -237,6 +236,14 @@ jobs:
237236
local head_sha="$2"
238237
local run_json run_id status conclusion
239238
239+
ci_gh() {
240+
if [ -n "${CI_TRIGGER_TOKEN:-}" ]; then
241+
GH_TOKEN="$CI_TRIGGER_TOKEN" "$@"
242+
else
243+
"$@"
244+
fi
245+
}
246+
240247
run_json="$(gh run list --repo "$REPO" \
241248
--workflow "CI" \
242249
--commit "$head_sha" \
@@ -267,8 +274,8 @@ jobs:
267274
esac
268275
269276
echo "Reactivating CI run $run_id for PR #$pr ($head_sha) (status=$status conclusion=$conclusion)."
270-
gh run rerun "$run_id" --repo "$REPO" --failed || \
271-
gh run rerun "$run_id" --repo "$REPO" || \
277+
ci_gh gh run rerun "$run_id" --repo "$REPO" --failed || \
278+
ci_gh gh run rerun "$run_id" --repo "$REPO" || \
272279
echo "Could not reactivate CI run $run_id; scheduled monitor will retry."
273280
}
274281

.github/workflows/shared/evergreen/repo-policy.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ readiness controller and the agentic orchestrator must both respect this file.
7373

7474
## Event Fast Paths
7575

76-
- `pull_request` activity types: `labeled`, `synchronize`, `reopened`,
77-
`ready_for_review`.
76+
- `pull_request` activity types: not wired in the gh-aw Evergreen workflow.
77+
PR activity is covered by schedule/manual/default-branch reconciliation to
78+
avoid gh-aw confused-deputy activation on bot-authored PRs.
7879
- Default-branch `push` policy: `push` to `main` wakes the reconciliation loop
7980
because it can make labeled PRs stale or conflicted.
80-
- `workflow_run` policy: not wired in v1; the schedule + `synchronize` cover CI
81-
state changes.
81+
- `workflow_run` policy: not wired in v1; the schedule covers CI state changes.
8282
- Review event policy: not wired (reviews are not merge gates here).
8383
- Deployment event policy: not wired (no deployment gates).
8484
- Slash-command policy: not wired in v1.
@@ -98,8 +98,8 @@ readiness controller and the agentic orchestrator must both respect this file.
9898
through safe outputs by the agent (never from preflight) and labeled
9999
`evergreen: trigger CI`; they do not count as semantic repair attempts.
100100
- Token policy: `GITHUB_TOKEN` for reads and control-plane label writes.
101-
`GH_AW_CI_TRIGGER_TOKEN` (existing PAT) is used by gh-aw for CI reruns and
102-
pushes so that PR branch pushes trigger CI (default-token pushes do not).
101+
`GH_AW_CI_TRIGGER_TOKEN` (existing PAT) is used only for CI reruns and
102+
safe-output pushes so default-token limitations do not block CI.
103103

104104
## Repair Policy
105105

0 commit comments

Comments
 (0)