Repository navigation
chore: sync 4 org-standard workflow stub(s) from petry-projects/.github #512
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
e5645b0
a6d5b40
59169c3
069893b
5b69120
ced5da3
888fb54
c948426
5f0923f
bc9ef83
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,66 @@ | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # SOURCE OF TRUTH: petry-projects/.github/standards/workflows/persona-mention.yml | ||
| # Standard: petry-projects/.github/standards/persona-standards.md (§4.1) | ||
| # Reusable: petry-projects/.github/.github/workflows/persona-mention-reusable.yml | ||
| # | ||
| # AGENTS — READ BEFORE EDITING: | ||
| # • This file is a THIN CALLER STUB. All routing logic lives in the reusable | ||
| # workflow above, and every per-persona decision lives in that persona's | ||
| # manifest — not here and not in the reusable. | ||
| # • You MUST NOT change: the `uses:` ref — it is pinned to the | ||
| # `persona-mention/v1-stable` channel, a moving tag advanced centrally. | ||
| # Never repoint it to `@main`, a SHA, or a frozen `@vX.Y.Z` (see | ||
| # ci-standards.md → Reusable workflow versioning). Also do not change the | ||
| # trigger events 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. | ||
| # • Do NOT add a per-persona stub. ONE router serves every persona (§4.1); | ||
| # a stub per agent is the drift the manifest exists to prevent. | ||
| # • If you need different behaviour, open a PR against the reusable in the | ||
| # central repo. A new release is rolled out by moving the channel tag | ||
| # centrally — never by editing callers, so no fanout PR is needed. | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
| # | ||
| # Persona Mention Router — thin caller for the org-level reusable. | ||
| # | ||
| # Adopting this file makes every persona that enables the `mention` surface | ||
| # addressable in this repo as `@petry-projects/<role>` — e.g. | ||
| # | ||
| # @petry-projects/qa-lead please assess test risk on this PR | ||
| # | ||
| # The handle is an org TEAM, never a user account: '@qa-lead' is a real GitHub | ||
| # account owned by an unrelated person (§4.1). | ||
| # | ||
| # To adopt: copy this file to .github/workflows/persona-mention.yml in your repo. | ||
| # Requires: GH_PAT_WORKFLOWS org secret (already present in petry-projects org). | ||
| name: Persona — Mention Router | ||
|
|
||
| on: | ||
| # issue_comment covers BOTH issues and PR conversation comments. | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| # Discussions cannot run an agent inline (#571) — but this router only parses | ||
| # and dispatches, and the agent itself runs on the resulting | ||
| # repository_dispatch, which is exactly the bridge the manifest declares. | ||
| discussion_comment: | ||
| types: [created] | ||
| # NOTE: reviewer assignment (pull_request/review_requested) is NOT subscribed | ||
| # here yet, even though §4 says "Reviewer-assignment counts here too". The | ||
| # router has no path for it, and a trigger that fires into a router which | ||
| # ignores it is a dead trigger that only burns runs. Tracked as finding 10 in | ||
| # petry-projects/.github#755; the trigger lands with the routing, not before. | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| persona-mention: | ||
| permissions: | ||
| contents: read # the reusable checks out its tooling repo — required, | ||
| # or the call fails at startup (a reusable is granted | ||
| # no more than the caller; persona-standards.md §5) | ||
| issues: read | ||
| pull-requests: read | ||
| uses: petry-projects/.github/.github/workflows/persona-mention-reusable.yml@persona-mention/v1-stable # NOSONAR(githubactions:S7637) first-party channel ref | ||
| secrets: inherit # NOSONAR(githubactions:S7635) org secrets are scoped to first-party reusables |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ | |
| # 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. | ||
| # This repo's CI workflow is named "CI" (.github/workflows/ci.yml). | ||
| # TODO: replace "CI" with your repository's CI workflow name(s). | ||
|
Check warning on line 31 in .github/workflows/pr-auto-review.yml
|
||
| workflow_run: | ||
| workflows: ["CI"] | ||
| types: [completed] | ||
|
|
@@ -44,24 +44,28 @@ | |
|
|
||
| permissions: {} | ||
|
|
||
| # Deduplicate ONLY pull_request events which have a direct PR context (issue #1126). | ||
| # On GitHub Free (20 concurrent jobs, org-wide), avoid race conditions when multiple | ||
| # PRs share a commit: | ||
| # • pull_request / pull_request_review — have github.event.pull_request.number; | ||
| # safe to collapse per PR and cancel in progress. | ||
| # • check_suite / workflow_run — only have pull_requests[] array; if multiple PRs | ||
| # share the commit, pull_requests[0] is indeterminate and causes the first PR's | ||
| # events to cancel the second PR's events. Use unique per-run groups instead. | ||
| # A trigger with no associated PR (fork / no PR) also falls back to unique-per-run | ||
| # so unrelated workflow runs never interfere. | ||
| # Deduplicate ONLY the default-branch-context triggers (issue #1126). On GitHub | ||
| # Free (20 concurrent jobs, org-wide) this stub fanned out per trigger. Its runs | ||
| # split by context: | ||
| # • check_suite / workflow_run — head_branch=main, the check does NOT attach to | ||
| # the PR head, so superseding an in-flight run is SAFE. Both events collapse | ||
| # onto one group per PR (`…-pr-<number>`) with cancel-in-progress: true. | ||
| # • pull_request / pull_request_review — run on the PR head; a cancelled run | ||
| # would leave a cancelled `pr-auto-review / check-and-dispatch` check on the | ||
| # head. They get a unique-per-run group and never cancel, so they behave | ||
| # exactly as before. | ||
| # A default-branch trigger with no associated PR (fork / no PR) also falls back to | ||
| # the unique-per-run group so unrelated PRs never collapse into one group. | ||
| concurrency: | ||
| group: >- | ||
| ${{ | ||
| (github.event_name == 'pull_request' && format('pr-auto-review-ready-check-pr-{0}', github.event.pull_request.number)) | ||
| || (github.event_name == 'pull_request_review' && format('pr-auto-review-ready-check-pr-{0}', github.event.pull_request.number)) | ||
| (github.event_name == 'check_suite' && github.event.check_suite.pull_requests | length == 1 && github.event.check_suite.pull_requests[0].number) | ||
|
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. P1: GitHub Actions expressions do not support Prompt for AI agents |
||
| && format('pr-auto-review-ready-check-pr-{0}', github.event.check_suite.pull_requests[0].number) | ||
| || (github.event_name == 'workflow_run' && github.event.workflow_run.pull_requests | length == 1 && github.event.workflow_run.pull_requests[0].number) | ||
| && format('pr-auto-review-ready-check-pr-{0}', github.event.workflow_run.pull_requests[0].number) | ||
| || format('pr-auto-review-ready-check-unique-{0}', github.run_id) | ||
| }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_review' }} | ||
| cancel-in-progress: ${{ github.event_name == 'check_suite' || github.event_name == 'workflow_run' }} | ||
|
|
||
| jobs: | ||
| pr-auto-review: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The gate output is interpolated into shell source, so a malformed value containing quotes or command substitutions can execute or break this step instead of reaching the validation; the failed step then blocks the fail-open dispatch. Pass the output through the step's
env:and read it from$DECISION.Prompt for AI agents