Skip to content

Commit 8473d01

Browse files
authored
Merge pull request atomvm#527 from UncleGrumpy/publish_docs
Prevent commit and push operations in Publish docs workflow in forks
2 parents a43aa52 + e63a340 commit 8473d01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/publish-docs.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171

7272
- uses: actions/checkout@v3
7373
with:
74-
repository: atomvm/AtomVM
74+
repository: ${{ vars.GITHUB_REPOSITORY }}
7575
fetch-depth: 0
7676

7777
- uses: actions/checkout@v3
@@ -84,7 +84,7 @@ jobs:
8484
- name: Build Site
8585
run: |
8686
. /home/runner/python-env/sphinx/bin/activate
87-
for remote in `git branch -r | grep -v /HEAD | grep -v ${{ github.ref_name }}`; do git checkout --track $remote; done
87+
for remote in `git branch -r | grep -v "/HEAD\|${{ github.ref_name }}"`; do git checkout --track $remote; done
8888
git switch ${{ github.ref_name }}
8989
git branch
9090
mkdir build
@@ -94,6 +94,7 @@ jobs:
9494
make GitHub_CI_Publish_Docs
9595
9696
- name: Commit files
97+
if: ${{ vars.GITHUB_REPOSITORY == 'atomvm/AtomVM' }}
9798
working-directory: /home/runner/work/AtomVM/AtomVM/www
9899
run: |
99100
git checkout Production
@@ -102,6 +103,7 @@ jobs:
102103
git add .
103104
git commit -m "Update Documentation"
104105
- name: Push changes
106+
if: ${{ vars.GITHUB_REPOSITORY == 'atomvm/AtomVM' }}
105107
working-directory: /home/runner/work/AtomVM/AtomVM/www
106108
run: |
107109
eval `ssh-agent -t 60 -s`

0 commit comments

Comments
 (0)