Skip to content

Commit 7a6fd04

Browse files
committed
Change trigger to pull_request_target
And then switch to PR code to utilize secrets from main repository
1 parent 7fdeae1 commit 7a6fd04

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/scala3doc.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request:
7+
pull_request_target:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
@@ -13,6 +13,19 @@ jobs:
1313
- name: Git Checkout
1414
uses: actions/checkout@v2
1515

16+
- name: Checkout to PR code
17+
env:
18+
PR_NUMBER: ${{ github.event.pull_request.number }}
19+
run : |
20+
if [[ -z "${PR_NUMBER}" ]]; then
21+
REF=refs/pull/$PR_NUMBER/merge
22+
echo checking $REF
23+
git fetch origin $REF:$REF
24+
git checkout $REF
25+
else
26+
echo Not a pull request do not need to checkout
27+
fi
28+
1629
- name: Cache Coursier
1730
uses: actions/cache@v1
1831
with:

0 commit comments

Comments
 (0)