Skip to content

Commit 26f05d4

Browse files
fix: share github secrets to dependabot (#712)
1 parent 8da6b2a commit 26f05d4

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/node.js.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
branches: [ dev, master ]
99
pull_request:
1010
branches: [ dev, master ]
11+
pull_request_target:
12+
branches: [ dev, master ]
1113

1214
jobs:
1315
build:
@@ -24,8 +26,21 @@ jobs:
2426
node-version: [14.x]
2527
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2628

29+
if: |
30+
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') ||
31+
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]')
32+
2733
steps:
28-
- uses: actions/checkout@v2
34+
- name: Checkout
35+
if: ${{ github.event_name != 'pull_request_target' }}
36+
uses: actions/checkout@v2
37+
38+
- name: Checkout PR
39+
if: ${{ github.event_name == 'pull_request_target' }}
40+
uses: actions/checkout@v2
41+
with:
42+
ref: ${{ github.event.pull_request.head.sha }}
43+
2944
- name: Use Node.js ${{ matrix.node-version }}
3045
uses: actions/setup-node@v2
3146
with:

0 commit comments

Comments
 (0)