File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 workflow_dispatch:
1010 push:
1111 branches: ["main"]
12- pull_request :
13- branches : ["main"]
1412 merge_group:
1513 branches: ["main"]
1614
@@ -37,10 +35,28 @@ jobs:
3735 fail-fast: false
3836 matrix:
3937 os: ["ubuntu-latest", "windows-latest"]
40- version : [22 ]
38+ version: [20 ]
4139
4240 runs-on: ${{ matrix.os }}
4341 steps:
42+
43+
44+ - name: Get User Permission
45+ id: checkAccess
46+ uses: actions-cool/check-user-permission@v2
47+ with:
48+ require: write
49+ username: ${{ github.triggering_actor }}
50+ env:
51+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+ - name: Check User Permission
53+ if: steps.checkAccess.outputs.require-result == 'false'
54+ run: |
55+ echo "${{ github.triggering_actor }} does not have permissions on this repo."
56+ echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
57+ echo "Job originally triggered by ${{ github.actor }}"
58+ exit 1
59+
4460 - if: runner.os == 'Linux'
4561 run: |
4662 sudo apt install libsecret-1-0
5167
5268 - if: ${{ github.event_name != 'pull_request_target'}}
5369 uses: actions/checkout@v4
70+ with :
71+ ref: ${{ github.event.pull_request.head.sha }} # This is dangerous without the first access check
5472
5573 - if: ${{ github.event_name == 'pull_request_target'}}
5674 uses: actions/checkout@v4
@@ -127,7 +145,7 @@ jobs:
127145 continue-on-error: true
128146
129147 - name: Live Tests
130- if : ${{ runner.os == 'windows ' }}
148+ if: ${{ runner.os == 'linux ' }}
131149 timeout-minutes: 60
132150 run: |
133151 npm run test:live
You can’t perform that action at this time.
0 commit comments