|
| 1 | +# Copyright 2026 UCP Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
1 | 15 | --- |
2 | 16 | name: PR Governance |
3 | 17 |
|
4 | | -on: |
| 18 | +# pull_request_target is required so the validator can read team memberships via |
| 19 | +# ORG_READ_TOKEN on PRs from forks and post the Governance / Approvals commit |
| 20 | +# status, while workflow_run re-evaluates when a review is submitted. No |
| 21 | +# PR-authored code is checked out or executed: the reusable workflow only reads |
| 22 | +# PR metadata via the GitHub API. |
| 23 | +on: # zizmor: ignore[dangerous-triggers] |
5 | 24 | pull_request_target: |
6 | | - types: [ |
7 | | - opened, |
8 | | - synchronize, |
9 | | - reopened, |
10 | | - ready_for_review, |
11 | | - review_requested, |
12 | | - review_request_removed, |
13 | | - assigned, |
14 | | - unassigned |
15 | | - ] |
| 25 | + branches: |
| 26 | + - main |
| 27 | + - "release/**" |
| 28 | + types: |
| 29 | + - opened |
| 30 | + - synchronize |
| 31 | + - reopened |
| 32 | + - ready_for_review |
| 33 | + - review_requested |
| 34 | + - review_request_removed |
| 35 | + - assigned |
| 36 | + - unassigned |
16 | 37 | workflow_run: |
17 | 38 | workflows: ["PR Review Listener"] |
18 | 39 | types: [completed] |
19 | 40 |
|
| 41 | +permissions: {} |
| 42 | + |
20 | 43 | jobs: |
21 | 44 | governance: |
22 | 45 | name: Reviews |
23 | 46 | permissions: |
24 | | - statuses: write |
25 | | - contents: read |
26 | | - pull-requests: read |
27 | | - # Use the reusable workflow defined in the central governance repository |
28 | | - # zizmor: ignore[ref-confusion] |
29 | | - uses: Universal-Commerce-Protocol/.github/.github/workflows/reusable-governance.yml@main |
| 47 | + statuses: write # Post the Governance / Approvals commit status |
| 48 | + # Reusable workflow from the central governance repository, hash-pinned per |
| 49 | + # the org's unpinned-uses policy. This pins only the orchestration: the |
| 50 | + # workflow checks out Universal-Commerce-Protocol/.github at ref: main, so |
| 51 | + # the rules file and validator scripts are always read from its default |
| 52 | + # branch. Governance rule changes apply without bumping this pin. |
| 53 | + uses: Universal-Commerce-Protocol/.github/.github/workflows/reusable-governance.yml@97682ca4ad40b4321d60bb58c869e12f19a8bcae # main |
30 | 54 | with: |
31 | 55 | pr-number: ${{ github.event.pull_request.number }} |
32 | 56 | commit-sha: ${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha }} |
|
0 commit comments