-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add pr-auto-review.yml workflow (compliance automation Phase 2) #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6b3cf03
252f48b
9bf671d
fdd9d05
f6127be
3cf003c
572a3de
cbeb27b
d64d3a3
b720bb0
0d40cfe
76e3d3a
3dcd9c5
371c9f5
8dbad49
506987b
a1e382c
e7ed9c5
484336e
1659207
b760418
05eff3c
e02516d
e1acf29
8d79c96
9c82e7f
54e9cbb
f72f9ee
86799d7
c3bb23f
de809d1
56fa6d6
8b0f36b
974d702
3946077
3b05be3
c8d614a
dd6e595
9562bae
7d5cd94
1774e2a
db2362f
76050ec
9c29b24
dba9471
3e4259b
cccd4f6
963e51c
368a4e0
c55445b
56aa1a2
4dc298a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # SOURCE OF TRUTH: petry-projects/.github/standards/workflows/pr-auto-review.yml | ||
| # Standard: petry-projects/.github/standards/ci-standards.md | ||
| # Reusable: petry-projects/.github/.github/workflows/pr-auto-review-reusable.yml | ||
| # | ||
| # AGENTS — READ BEFORE EDITING: | ||
| # • This file is a THIN CALLER STUB. All readiness-gate logic lives in the | ||
| # reusable workflow above. | ||
| # • You MAY change: the tag in the `uses:` line when upgrading the reusable | ||
| # workflow version (e.g. bump `@v2` → `@v3` when petry-projects/.github cuts | ||
| # a new release), and the workflow name(s) in `workflow_run.workflows` to | ||
| # match your repository's CI workflow name(s). | ||
| # • You MUST NOT change: trigger event types or the job-level `permissions:` | ||
| # block — reusable workflows can be granted no more permissions than the | ||
| # calling job, so removing the stanza breaks the reusable's gh API calls. | ||
| # • If you need different behaviour, open a PR against the reusable in the | ||
| # central repo. | ||
| # • When publishing a new version of this reusable, also update this template | ||
| # and open a fanout PR across all caller repos. | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # | ||
| # PR Auto-Review — thin caller for the org-level reusable. | ||
| # To adopt: copy this file to .github/workflows/pr-auto-review.yml in your repo. | ||
| # Requires: GH_PAT_WORKFLOWS org secret (already present in petry-projects org). | ||
| name: PR Auto-Review — Ready Check | ||
|
|
||
| on: | ||
| # workflow_run fires when a named GitHub Actions workflow completes. | ||
| # check_suite does NOT trigger for GitHub Actions runs, so this is required | ||
| # to catch CI turning green on a PR. | ||
| workflow_run: | ||
| workflows: ['Node.js Tests', 'CI Pipeline'] | ||
| types: [completed] | ||
| # check_suite covers third-party CI checks (e.g. SonarCloud, external apps). | ||
| check_suite: | ||
| types: [completed] | ||
| # Re-evaluate readiness after review state changes. | ||
| pull_request_review: | ||
| types: [submitted, dismissed] | ||
| # Re-evaluate when the PR is first opened, updated, or comes out of draft. | ||
| pull_request: | ||
| types: [opened, reopened, synchronize, ready_for_review] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| pr-auto-review: | ||
| # Skip fork PRs on pull_request and pull_request_review events — forks don't | ||
| # receive org secrets, so GH_PAT_WORKFLOWS would be empty and the reusable's | ||
| # gh api calls would fail. Other triggers (workflow_run, check_suite) always | ||
| # run in the base-repo context and have full secret access. | ||
| if: > | ||
| (github.event_name != 'pull_request' && github.event_name != 'pull_request_review') || | ||
| github.event.pull_request.head.repo.fork == false | ||
|
Comment on lines
+52
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For Useful? React with 👍 / 👎. |
||
| permissions: | ||
| pull-requests: read | ||
| checks: read | ||
| actions: read | ||
| uses: petry-projects/.github/.github/workflows/pr-auto-review-reusable.yml@v2 | ||
| secrets: | ||
| GH_PAT_WORKFLOWS: ${{ secrets.GH_PAT_WORKFLOWS }} | ||
Uh oh!
There was an error while loading. Please reload this page.