Only publish if we are in the original repo

This avoids people having failing actions in forks of our repo since
they don't have permission to publish things.
This commit is contained in:
Pierre Ossman 2021-11-09 16:21:41 +01:00
parent bbbcab692a
commit c2980d15e9
1 changed files with 6 additions and 0 deletions

View File

@ -31,18 +31,21 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: |
github.repository == 'novnc/noVNC' &&
github.event_name == 'release' &&
!github.event.release.prerelease
- run: npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: |
github.repository == 'novnc/noVNC' &&
github.event_name == 'release' &&
github.event.release.prerelease
- run: npm publish --access public --tag dev
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: |
github.repository == 'novnc/noVNC' &&
github.event_name == 'push' &&
github.event.ref == 'refs/heads/master'
snap:
@ -72,6 +75,7 @@ jobs:
snap: ${{ steps.snapcraft.outputs.snap }}
release: stable
if: |
github.repository == 'novnc/noVNC' &&
github.event_name == 'release' &&
!github.event.release.prerelease
- uses: snapcore/action-publish@v1
@ -80,6 +84,7 @@ jobs:
snap: ${{ steps.snapcraft.outputs.snap }}
release: beta
if: |
github.repository == 'novnc/noVNC' &&
github.event_name == 'release' &&
github.event.release.prerelease
- uses: snapcore/action-publish@v1
@ -88,5 +93,6 @@ jobs:
snap: ${{ steps.snapcraft.outputs.snap }}
release: edge
if: |
github.repository == 'novnc/noVNC' &&
github.event_name == 'push' &&
github.event.ref == 'refs/heads/master'