Skip to content

Commit 6d898c8

Browse files
committed
[DEV-5554] fix forks prs to avoid usage of large runners
1 parent 86c6258 commit 6d898c8

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/push.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
jobs:
22+
check_membership:
23+
name: Check membership
24+
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
25+
runs-on: ubuntu-22.04
26+
outputs:
27+
skip: ${{ steps.skip.outputs.skip }}
28+
steps:
29+
- uses: tspascoal/get-user-teams-membership@v1
30+
id: membership
31+
if: "github.actor != 'dependabot[bot]'"
32+
with:
33+
username: ${{ github.actor }}
34+
team: 'team'
35+
GITHUB_TOKEN: ${{ secrets.READ_ORG_TOKEN }}
36+
- id: skip
37+
if: "github.event_name == 'pull_request_target' && github.actor != 'dependabot[bot]' && steps.membership.outputs.isTeamMember == 'false'"
38+
run: echo "skip=true" >> $GITHUB_OUTPUT
2239
static_checks:
2340
name: Static checks
2441
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
@@ -185,7 +202,8 @@ jobs:
185202
athenian/api/models/state/check_sdb_migrations.sh
186203
test:
187204
name: Test suite
188-
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
205+
needs: check_membership
206+
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push' && needs.check_membership.outputs.skip != 'true'"
189207
runs-on:
190208
# yes, we over-commit threads to cores x2
191209
labels: ubuntu-latest-32-cores
@@ -371,7 +389,8 @@ jobs:
371389
token: ${{ secrets.CODECOV_TOKEN }}
372390
test-extra:
373391
name: Additional tests
374-
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push'"
392+
needs: check_membership
393+
if: "!contains(github.event.head_commit.message, 'Bump version') || github.event_name != 'push' && needs.check_membership.outputs.skip != 'true'"
375394
runs-on: ubuntu-22.04
376395
concurrency:
377396
group: auth0-${{ github.actor }}-${{ matrix.type == 'user' && 'user' || github.head_ref || github.run_id }}-${{ matrix.db }}-${{ matrix.type }}

0 commit comments

Comments
 (0)