Skip to content

Commit d75ed47

Browse files
committed
chore: fix benchmark script syntax
You cannot use a secret as part of an if expression in actions
1 parent 7c4ee92 commit d75ed47

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/benchmark.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,25 @@ jobs:
1515
steps:
1616
- name: Incoming Pull Request
1717
if: |
18-
secrets.NPM_BENCHMARKS_TOKEN && (
19-
github.event_name == 'pull_request' ||
20-
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
21-
startsWith(github.event.comment.body, 'test this please ✅')))
18+
github.event_name == 'pull_request' || (
19+
github.event_name == 'issue_comment' &&
20+
github.event.issue.pull_request &&
21+
startsWith(github.event.comment.body, 'test this please ✅')
22+
)
2223
env:
2324
# gh cli uses these env vars for owner/repo/token
2425
GH_REPO: "npm/benchmarks"
2526
GITHUB_TOKEN: ${{ secrets.NPM_BENCHMARKS_TOKEN }}
2627
run: |
28+
if [[ "$GITHUB_TOKEN" == "" ]]; then
29+
echo "No auth - from fork pull request, exiting"
30+
exit 0
31+
fi
32+
2733
EVENT_NAME="${{ github.event_name }}"
2834
OWNER="${{ github.event.repository.owner.login }}"
2935
REPO="${{ github.event.repository.name }}"
36+
PR=""
3037
3138
if [[ "$EVENT_NAME" == "pull_request" ]]; then
3239
PR="${{ github.event.pull_request.number }}"
@@ -49,7 +56,6 @@ jobs:
4956
steps:
5057
- name: Incoming Comment
5158
if: |
52-
secrets.NPM_BENCHMARKS_TOKEN &&
5359
github.event_name == 'issue_comment' &&
5460
github.event.issue.pull_request &&
5561
startsWith(github.event.comment.body, 'test this please ✅')

0 commit comments

Comments
 (0)