Skip to content

Commit fd7bf74

Browse files
Fix: Allow Codegen bot to bypass permission check in GitHub Actions workflow
1 parent 3914401 commit fd7bf74

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
jobs:
1414
access-check:
1515
runs-on: ubuntu-latest
16+
# Skip the access check if the triggering actor is the Codegen bot
17+
if: github.triggering_actor != 'codegen-sh[bot]'
1618
steps:
1719
- uses: actions-cool/check-user-permission@v2
1820
with:
@@ -21,7 +23,8 @@ jobs:
2123
error-if-missing: true
2224

2325
unit-tests:
24-
needs: access-check
26+
# Only need access-check if not the bot
27+
needs: ${{ github.triggering_actor != 'codegen-sh[bot]' && 'access-check' || '' }}
2528
runs-on: ubuntu-latest-8
2629
steps:
2730
- uses: actions/checkout@v4
@@ -48,7 +51,8 @@ jobs:
4851
codecov_token: ${{ secrets.CODECOV_TOKEN }}
4952

5053
codemod-tests:
51-
needs: access-check
54+
# Only need access-check if not the bot
55+
needs: ${{ github.triggering_actor != 'codegen-sh[bot]' && 'access-check' || '' }}
5256
# TODO: re-enable when this check is a develop required check
5357
if: false
5458
runs-on: ubuntu-latest-32
@@ -90,7 +94,8 @@ jobs:
9094
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
9195

9296
parse-tests:
93-
needs: access-check
97+
# Only need access-check if not the bot
98+
needs: ${{ github.triggering_actor != 'codegen-sh[bot]' && 'access-check' || '' }}
9499
if: contains(github.event.pull_request.labels.*.name, 'parse-tests') || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
95100
runs-on: ubuntu-latest-32
96101
steps:
@@ -161,7 +166,8 @@ jobs:
161166
}
162167
163168
integration-tests:
164-
needs: access-check
169+
# Only need access-check if not the bot
170+
needs: ${{ github.triggering_actor != 'codegen-sh[bot]' && 'access-check' || '' }}
165171
runs-on: ubuntu-latest-16
166172
steps:
167173
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)