Repository navigation
fix(ci): remediate dangerous pull request triggers - #132
yvonnedevlinrh merged 1 commit into
Conversation
6e34af9 to
eebfc15
Compare
|
This follows ComplyTime's established dependency-workflow model, rather than reintroducing Why the split is safe:
The trust boundary is intentional: contributors who can open branches in this repository are trusted collaborators. For untrusted contributors, This matches the upstream ComplyTime template at |
eebfc15 to
d359ac1
Compare
marcusburghardt
left a comment
There was a problem hiding this comment.
PR Review: #132 — fix(ci): remediate dangerous pull request triggers
Verdict: APPROVE
The pull_request_target → pull_request migration is correctly implemented end-to-end: trigger change, all event-name guards, static-signal validation, concurrency group key, and structural tests that lock in regressions are all consistent. Restricted-token handling fails closed for approvals and skips safely for comments, with both paths covered by new tests. The Fullsend zizmor exception is the minimum possible scope (one rule, one file) and is byte-for-byte verified by a test citing the authorization issue.
Two LOW findings noted as inline comments — neither blocks merge.
This review was generated by /uf.review-pr (AI-assisted).
| } | ||
| core.notice('Automated approval skipped: this pull-request token cannot write reviews. A maintainer must approve the Dependabot update manually.'); | ||
| core.setFailed('Manual review required: token cannot approve this Dependabot pull request.'); | ||
| throw new Error('Token cannot approve this Dependabot pull request.'); |
There was a problem hiding this comment.
[LOW] Triple failure signal in restricted-token catch block
core.setFailed() (line 316) already marks the job as failed. The subsequent throw new Error(...) causes actions/github-script to call core.setFailed again with the thrown error message, producing two redundant failure annotations in the job summary. Fail-closed behavior is preserved — this is cosmetic only.
Consider removing either the throw or the core.setFailed call to avoid duplicate annotations. The core.setFailed alone is sufficient to fail the job and surface the message.
| ].join('\n'), | ||
| }); | ||
| } catch (error) { | ||
| const restrictedTokenError = error?.status === 403 |
There was a problem hiding this comment.
[LOW] restrictedTokenError defined inconsistently across comment and approval paths
In the comment script (line 142), restrictedTokenError is a function: const restrictedTokenError = (error) => .... Here in the approval script, it's an inline boolean: const restrictedTokenError = error?.status === 403 && .... Both detect the same condition correctly, but the inconsistency increases maintenance surface — a future editor updating one must remember the other uses a different pattern.
Consider extracting a shared helper or using the same pattern in both scripts.
- Run dependency review without privileged pull-request execution - Scope and document the Fullsend zizmor exception - Cover restricted-token write degradation in workflow policy tests Assisted-by: gpt-5.6-terra Generated with AI assistance (gpt-5.6-terra)
d359ac1 to
8e66020
Compare
Summary
Fixes #127
Removes privileged dependency-review execution by moving it from
pull_request_targettopull_request.Adds safe handling for restricted GitHub tokens: report-comment writes skip with an actionable notice, while denied approval writes fail closed and require manual review. Documents the Fullsend trust boundary and scopes its unavoidable zizmor exception to
dangerous-triggersinfullsend.yaml.How to Test
CI should also run MegaLinter, zizmor, and actionlint.
How to Demo
Open a Dependabot pull request targeting main:
Key Files Changed
This PR was generated by /uf.finale (AI-assisted).