Skip to content

Commit

Permalink
build: skip publish npm if user not part of pyroscope org (#1594)
Browse files Browse the repository at this point in the history
* build: skip publish npm if user not part of pyroscope org

* fix

* wrong bool

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .
  • Loading branch information
eh-am committed Oct 4, 2022
1 parent c8631d7 commit 34c50b3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/publish-lib-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@ on:
branches: [main]

jobs:
check:
runs-on: ubuntu-latest
outputs:
inputsChecked: ${{ steps.github_token_gate.outputs.inputsChecked }}
steps:
- uses: svrooij/secret-gate-action@v1
id: github_token_gate
with:
inputsToCheck: 'token'
env:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
build:
# skip if user has not access to the token
if: needs.check.outputs.inputsChecked == 'true'
runs-on: ubuntu-latest
# Don't run for forks
needs: check
steps:
#######################
# Checkout #
Expand All @@ -20,7 +33,6 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.BOT_GITHUB_TOKEN }}

# For pull requests, also checkout out the REAL commit (as opposed to a merge commit with main)
- uses: actions/checkout@v2
if: github.event_name == 'pull_request'
Expand Down

0 comments on commit 34c50b3

Please sign in to comment.