Skip to content

Commit 12bcb3d

Browse files
authored
Update build-and-test-prs.yml for dependabot access
1 parent 39b0290 commit 12bcb3d

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

.github/workflows/build-and-test-prs.yml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build & test # on PRs (including forks) and push to develop/main
1+
name: Build & test # on both PRs and push to develop/main
22

33
on:
44
pull_request_target:
@@ -10,30 +10,7 @@ jobs:
1010
build-and-test:
1111
runs-on: ubuntu-latest
1212
steps:
13-
# Get user permission of workflow triggering actor, return true or false
14-
- name: Get Workflow Actor Permission
15-
id: checkAccess
16-
# Action used: https://github.com/actions-cool/check-user-permission
17-
uses: actions-cool/check-user-permission@v2
18-
with:
19-
require: write
20-
username: ${{ github.triggering_actor }}
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
# Check user permission from previous step, exit if false
24-
- name: Check Workflow Actor Permission
25-
if: steps.checkAccess.outputs.require-result == 'false'
26-
run: |
27-
echo "${{ github.triggering_actor }} does not have permissions to run workflows on this repo."
28-
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
29-
echo "Job originally triggered by ${{ github.actor }}"
30-
exit 1
31-
# Checkout PR code
32-
- name: Checkout code
33-
uses: actions/checkout@v4
34-
with:
35-
# This is dangerous without the first access check
36-
ref: ${{ github.event.pull_request.head.sha }}
13+
- uses: actions/checkout@v4
3714
- name: Get yarn cache directory path
3815
id: yarn-cache-dir-path
3916
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -48,11 +25,14 @@ jobs:
4825
- name: Use NodeJs
4926
uses: actions/setup-node@v3
5027
with:
51-
node-version: "20.x"
28+
node-version: '20.x'
29+
5230
- name: Install dependencies
5331
run: yarn install --frozen-lockfile --non-interactive
32+
5433
- name: Run linting
5534
run: yarn lint
35+
5636
- name: Build app
5737
run: yarn build
5838
env:

0 commit comments

Comments
 (0)