mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
CI: restrict review-checklist workflows to HDFGroup/hdf5 only (#6515)
These workflows use pull_request_target / workflow_run with elevated permissions (pull-requests: write, issues: write). Because GitHub copies workflow files into forks, any fork with Actions enabled was independently running these privileged workflows against its own PRs, e.g. https://github.com/sp26-hdfgroup/hdf5-sandbox/pull/2. Add the same github.repository == 'HDFGroup/hdf5' guard already used in review-checklist-test.yml so the job-level if short-circuits before doing anything in a fork's copy of the workflow.
This commit is contained in:
@@ -21,6 +21,6 @@ permissions: {}
|
||||
jobs:
|
||||
signal:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.base.ref == 'develop'
|
||||
if: github.repository == 'HDFGroup/hdf5' && github.event.pull_request.base.ref == 'develop'
|
||||
steps:
|
||||
- run: echo "Review submitted on PR ${{ github.event.pull_request.number }}"
|
||||
|
||||
@@ -42,8 +42,9 @@ jobs:
|
||||
checklist:
|
||||
runs-on: ubuntu-latest
|
||||
if: >
|
||||
(github.event_name == 'pull_request_target' && github.event.pull_request.base.ref == 'develop') ||
|
||||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
|
||||
github.repository == 'HDFGroup/hdf5' &&
|
||||
((github.event_name == 'pull_request_target' && github.event.pull_request.base.ref == 'develop') ||
|
||||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success'))
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user