Skip to content

Commit

Permalink
chore: fix benchmark script syntax
Browse files Browse the repository at this point in the history
You cannot use a secret as part of an if expression in actions
  • Loading branch information
lukekarrys committed Apr 14, 2022
1 parent 7c4ee92 commit d75ed47
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 ✅')
Expand Down

0 comments on commit d75ed47

Please sign in to comment.