Prevent recursive workflows triggered by the Project GitHub App - #188
Merged
Merged
Conversation
Collaborator
Author
|
/kelos review |
|
🤖 Kelos Task Status Task |
|
🤖 Open Actions Reviewer Agent @gjkim42 Review SummaryVerdict: APPROVE Findings Overview
FindingsGitHub Actions compatibility
Suggestions (optional)
Key takeaways (optional)
|
Suppress repository mutations and native workflow notifications from the dedicated Project App, preserving explicit dispatch exceptions. Require approval for eligible App-triggered pull requests and retain fork credential restrictions independently. Cover webhook suppression and Console approval with unit, conformance, and Kubernetes end-to-end tests.
gjkim42
force-pushed
the
fix/job-token-trigger-suppression
branch
from
October 1, 2026 14:13
40d2d0f to
9ec27d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind api
What this PR does / why we need it:
A workflow that posts an issue comment using the built-in job token can trigger another Open Actions run and keep repeating. Apply the recursive-trigger policy centrally during authenticated webhook delivery processing, before workflow discovery or WorkflowRun creation.
pull_requestopened,synchronize, andreopenedevents with an immutablespec.approvalrequirement. Reuse the authenticated Console approval operation, validate the pinned head before planning, and supersede pending runs when another revision arrives. Fork credential restrictions remain independent.workflow_runnotifications sent by the Project App, allow only native runs triggered byworkflow_dispatchorrepository_dispatch; suppress push-triggered runs and other or missing origins. Suppress derivedpull_request_targetevents from the Project App.The policy follows GitHub's documented GITHUB_TOKEN rules for supported triggers.
Which issue(s) this PR is related to:
Related to #114. This addresses recursive triggers for dedicated Project Apps; token lifetime/refresh, token-level attribution for shared Apps, and GitHub API dispatch support remain open.
Special notes for your reviewer:
The Project App must be reserved for Open Actions. GitHub webhook payloads identify the App actor, not the individual installation token, so separately issued tokens for the same App receive the same policy. Other automation that should trigger workflows must use another App or a PAT. This restriction is documented in the quickstart and reference. The filter affects Open Actions only, not GitHub's native workflow engine. App-sent lifecycle notifications for native PR runs and native workflow chains are suppressed because their payloads do not establish approval or the original trigger; remaining compatibility work is tracked in #114.
Apply the updated WorkflowRun CRD with the controller upgrade. The approval requirement is independent of
forkPullRequest, so approved same-repository runs retain their normal token permissions and secret access. The Console reuses its existing approval control and authentication/CSRF path.Validation:
make testmake verifymake test TEST_FLAGS='-tags=e2e -run=^$'(compiles the end-to-end suite locally).workflow_runcases cover suppression after an App push, allowed explicit dispatch, and allowed human push. A signed App pull request persists its approval requirement in Kubernetes and creates a job only after authenticated Console approval.Does this PR introduce a user-facing change?