Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Karrys <luke@lukekarrys.com>2022-04-14 04:21:36 +0300
committerLuke Karrys <luke@lukekarrys.com>2022-04-15 00:32:10 +0300
commitd75ed474b4ed5bcf259936d29aa3a9937800010d (patch)
treea136b113bca4f5e9dd4bfe84cd22ef45bdb2b86a /.github
parent7c4ee929a8d7e0c6a55a974db280d8eeb10d279e (diff)
chore: fix benchmark script syntax
You cannot use a secret as part of an if expression in actions
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/benchmark.yml16
1 files changed, 11 insertions, 5 deletions
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
index c97619e1e..1d8e3455c 100644
--- a/.github/workflows/benchmark.yml
+++ b/.github/workflows/benchmark.yml
@@ -15,18 +15,25 @@ jobs:
steps:
- name: Incoming Pull Request
if: |
- secrets.NPM_BENCHMARKS_TOKEN && (
- github.event_name == 'pull_request' ||
- (github.event_name == 'issue_comment' && github.event.issue.pull_request &&
- startsWith(github.event.comment.body, 'test this please ✅')))
+ github.event_name == 'pull_request' || (
+ github.event_name == 'issue_comment' &&
+ github.event.issue.pull_request &&
+ startsWith(github.event.comment.body, 'test this please ✅')
+ )
env:
# gh cli uses these env vars for owner/repo/token
GH_REPO: "npm/benchmarks"
GITHUB_TOKEN: ${{ secrets.NPM_BENCHMARKS_TOKEN }}
run: |
+ if [[ "$GITHUB_TOKEN" == "" ]]; then
+ echo "No auth - from fork pull request, exiting"
+ exit 0
+ fi
+
EVENT_NAME="${{ github.event_name }}"
OWNER="${{ github.event.repository.owner.login }}"
REPO="${{ github.event.repository.name }}"
+ PR=""
if [[ "$EVENT_NAME" == "pull_request" ]]; then
PR="${{ github.event.pull_request.number }}"
@@ -49,7 +56,6 @@ jobs:
steps:
- name: Incoming Comment
if: |
- secrets.NPM_BENCHMARKS_TOKEN &&
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.comment.body, 'test this please ✅')