Skip to content

Commit 548f03b

Browse files
authored
move unapproved static checks to a separate workflow (#2618)
Signed-off-by: Itai Segall <[email protected]>
1 parent 506f2c1 commit 548f03b

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

.github/workflows/build.static_tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
self_hosted:
1010
type: boolean
1111
required: true
12+
skip_todo_check:
13+
type: boolean
14+
required: false
15+
default: false
1216

1317
jobs:
1418
static_tests:
@@ -53,6 +57,7 @@ jobs:
5357

5458
- name: Checking TODOs
5559
uses: ./.github/actions/nix/run_bash_command_in_nix
60+
if: ${{ inputs.skip_todo_check == false }}
5661
with:
5762
cmd: |
5863
echo "PR number: $CIRCLE_PULL_REQUEST"

.github/workflows/pr_non_contributors.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,3 @@ jobs:
3232
needs: env_hold
3333
with:
3434
commit_sha: ${{ github.event.pull_request.head.sha }}
35-
36-
# Note: unapproved runs must not be granted access to secrets, and must not run on self-hosted runners
37-
no_approval_static_tests:
38-
name: Static Tests (No Approval Required)
39-
uses: ./.github/workflows/build.static_tests.yml
40-
if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
41-
secrets: {} # Explcitly do not grant access to secrets
42-
permissions:
43-
contents: read
44-
pull-requests: read # Required for the static tests
45-
issues: read # Required for the static tests
46-
with:
47-
self_hosted: false
48-
commit_sha: ${{ github.event.pull_request.head.sha }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Static checks for PRs from forks (No Approval Required)
2+
on:
3+
# unapproved runs must be on: pull_request, to prevent cache pollution on main
4+
pull_request:
5+
types: [ opened, synchronize, reopened ]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
# Note: unapproved runs must not be granted access to secrets, and must not run on self-hosted runners
13+
no_approval_static_tests:
14+
name: Static Tests
15+
uses: ./.github/workflows/build.static_tests.yml
16+
if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
17+
secrets: {} # Explcitly do not grant access to secrets
18+
permissions:
19+
contents: read
20+
with:
21+
self_hosted: false
22+
commit_sha: ${{ github.event.pull_request.head.sha }}
23+
skip_todo_check: true # runs from forks with on: pull_request run in context of the fork, so issue references will be broken

0 commit comments

Comments
 (0)