Skip to content

Commit 77e2165

Browse files
authored
Merge pull request #10575 from romanowski/scala3doc/fix-gh-action
Fix scala3doc GH actions
2 parents 90f44d4 + 8dd4bc1 commit 77e2165

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

.github/workflows/scala3doc.yaml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,18 @@ name: CI for Scala3doc
22

33
on:
44
push:
5-
branches:
6-
- master
7-
pull_request_target:
5+
pull_request:
86
jobs:
97
build:
8+
env:
9+
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
1010
runs-on: ubuntu-latest
11+
if: "github.event_name == 'pull_request' || contains(github.event.ref, 'scala3doc') || contains(github.event.ref, 'master')"
1112

1213
steps:
1314
- name: Git Checkout
1415
uses: actions/checkout@v2
1516

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-
echo Not a pull request do not need to checkout
22-
else
23-
REF=refs/pull/$PR_NUMBER/merge
24-
echo checking $REF
25-
git fetch origin $REF:$REF
26-
git checkout $REF
27-
fi
28-
2917
- name: Cache Coursier
3018
uses: actions/cache@v1
3119
with:
@@ -68,12 +56,12 @@ jobs:
6856

6957
- name: Upload documentation to server
7058
uses: azure/CLI@v1
71-
env:
72-
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
59+
if: env.AZURE_STORAGE_SAS_TOKEN
60+
env:
7361
PR_NUMBER: ${{ github.event.pull_request.number }}
7462
with:
7563
inlineScript: |
76-
DOC_DEST=pr-${PR_NUMBER:-master}
64+
DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}}
7765
echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
7866
az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
7967
az storage blob sync -s scala3doc/output -c $DOC_DEST --account-name scala3docstorage

0 commit comments

Comments
 (0)