Skip to content

[Snyk] Fix for 1 vulnerabilities #639

[Snyk] Fix for 1 vulnerabilities

[Snyk] Fix for 1 vulnerabilities #639

Workflow file for this run

name: Benchmark - CLI
on:
pull_request:
branches:
- '*'
issue_comment:
types:
- created
- edited
jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- name: Incoming Pull Request
if: |

Check failure on line 17 in .github/workflows/benchmark.yml

View workflow run for this annotation

GitHub Actions / Benchmark - CLI

Invalid workflow file

The workflow is not valid. .github/workflows/benchmark.yml (Line: 17, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: 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/workflows/benchmark.yml (Line: 51, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.NPM_BENCHMARKS_TOKEN && github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, 'test this please ✅')
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 ✅')))
env:
# gh cli uses these env vars for owner/repo/token
GH_REPO: "npm/benchmarks"
GITHUB_TOKEN: ${{ secrets.NPM_BENCHMARKS_TOKEN }}
run: |
EVENT_NAME="${{ github.event_name }}"
OWNER="${{ github.event.repository.owner.login }}"
REPO="${{ github.event.repository.name }}"
if [[ "$EVENT_NAME" == "pull_request" ]]; then
PR="${{ github.event.pull_request.number }}"
else
PR="${{ github.event.issue.number }}"
fi
EVENT="${EVENT_NAME} ${OWNER}/${REPO}#${PR}"
echo '{
"event_type": "'"$EVENT"'",
"client_payload": {
"pr_id": "'"$PR"'",
"repo": "'"$REPO"'",
"owner": "'"$OWNER"'"
}
}' | gh api repos/{owner}/{repo}/dispatches --input -
comment:
runs-on: ubuntu-latest
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 ✅')
env:
# gh cli uses this env var as the token
GITHUB_TOKEN: ${{ secrets.NPM_BENCHMARKS_TOKEN }}
run: |
COMMENT_NODE_ID="${{ github.event.comment.node_id }}"
QUERY='mutation ($inputData:AddReactionInput!) {
addReaction (input:$inputData) {
reaction { content }
}
}'
echo '{
"query": "'${QUERY}'",
"variables": {
"inputData": {
"subjectId": "'"${COMMENT_NODE_ID}"'",
"content": "ROCKET"
}
}
}' | gh api graphql --input -