Title: Syntax Error only on Actions? · Issue #567 · actions/github-script · GitHub
Open Graph Title: Syntax Error only on Actions? · Issue #567 · actions/github-script
X Title: Syntax Error only on Actions? · Issue #567 · actions/github-script
Description: Describe the bug I've been testing very thoroughly some code that only has a Syntax Error on an actions/github-script@v7 run. To Reproduce The following script fails: Full file name: Clippy changelog check on: merge_group: pull_request: ...
Open Graph Description: Describe the bug I've been testing very thoroughly some code that only has a Syntax Error on an actions/github-script@v7 run. To Reproduce The following script fails: Full file name: Clippy changel...
X Description: Describe the bug I've been testing very thoroughly some code that only has a Syntax Error on an actions/github-script@v7 run. To Reproduce The following script fails: Full file name: Clippy cha...
Opengraph URL: https://github.com/actions/github-script/issues/567
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Syntax Error only on Actions?","articleBody":"**Describe the bug**\nI've been testing very thoroughly some code that only has a Syntax Error on an actions/github-script@v7 run.\n\n**To Reproduce**\nThe following script fails:\n\u003cdetails>\n\u003csummary>\nFull file\n\u003c/summary>\n\n```yaml\n\nname: Clippy changelog check\n\non:\n merge_group:\n pull_request:\n types: [opened, reopened, synchronize, edited]\n\nconcurrency:\n # For a given workflow, if we push to the same PR, cancel all previous builds on that PR.\n # If the push is not attached to a PR, we will cancel all builds on the same branch.\n group: \"${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}\"\n cancel-in-progress: true\n\njobs:\n\n changelog:\n runs-on: ubuntu-latest\n\n defaults:\n run:\n shell: bash\n\n steps:\n # Run\n - name: Check Changelog\n if: ${{ github.event_name == 'pull_request' }}\n run: |\n body=$(curl -H \"Authorization: token ${{ secrets.GITHUB_TOKEN }}\" -s \"https://api.github.com/repos/blyxyas/rust-clippy/pulls/$PR_NUMBER\" | \\\n python -c \"import sys, json; print(json.load(sys.stdin)['body'])\")\n output=$(awk '/^changelog:\\s*\\S/ && !/changelog: \\[.*\\]: your change/' \u003c\u003c\u003c \"$body\" | sed \"s/changelog:\\s*//g\")\n if [ -z \"$output\" ]; then\n echo \"ERROR: pull request message must contain 'changelog: ...' with your changelog. Please add it.\"\n exit 1\n else\n echo \"changelog: $output\"\n if [[ \"${output}\" == \\[\\`* ]]; then\n echo \"LINT_CHANGELOG=\\\"${output}\\\"\" >> $GITHUB_ENV\n else\n echo \"LINT_CHANGELOG=\\\"meowmeow\\\"\" >> $GITHUB_ENV\n fi\n fi\n env:\n PYTHONIOENCODING: 'utf-8'\n PR_NUMBER: '${{ github.event.number }}'\n - name: New Lint Label\n uses: actions/github-script@v7\n with:\n script: |\n let res = await github.rest.issues.listLabelsOnIssue({\n owner: 'blyxyas',\n repo: 'rust-clippy',\n issue_number: ${{ github.event.number }}\n })\n let names = res.data.map((element) => element.name);\n\n // We've already visited this PR\n if (!names.includes('A-new-lint')) {\n // Check if we're with a new lint (there are 0 mentions of this lint on the codebase\n if (${{ env.LINT_CHANGELOG }} != \"\") {\n const lint_name = /\\[`(.*)`\\]/g.exec(${{ env.LINT_CHANGELOG }}).slice(1);\n let lint_name_upper = lint_name.toString().toUpperCase();\n let res = await octokit.rest.search.code({\n q: `${lint_name_upper} repo:rust-lang/rust-clippy`,\n per_page: 1,\n });\n \n if (res.data.items.length == 0) {\n await octokit.rest.issues.createComment({\n owner: \"blyxyas\",\n repo: \"rust-clippy\",\n issue_number: ${{ github.event.number }},\n body: \"Seems that you are trying to add a new lint! We are currently in a feature freeze, I'll add it to a milestone.\"\n });\n }\n }\n }\n \n\n # We need to have the \"conclusion\" job also on PR CI, to make it possible\n # to add PRs to a merge queue.\n conclusion_changelog:\n needs: [ changelog ]\n # We need to ensure this job does *not* get skipped if its dependencies fail,\n # because a skipped job is considered a success by GitHub. So we have to\n # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run\n # when the workflow is canceled manually.\n #\n # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!\n if: ${{ !cancelled() }}\n runs-on: ubuntu-latest\n steps:\n # Manually check the status of all dependencies. `if: failure()` does not work.\n - name: Conclusion\n run: |\n # Print the dependent jobs to see them in the CI log\n jq -C \u003c\u003c\u003c '${{ toJson(needs) }}'\n # Check if all jobs that we depend on (in the needs array) were successful.\n jq --exit-status 'all(.result == \"success\")' \u003c\u003c\u003c '${{ toJson(needs) }}'\n```\n\n\u003c/details>\n\n```js\n let res = await github.rest.issues.listLabelsOnIssue({\n owner: 'blyxyas',\n repo: 'rust-clippy',\n issue_number: ${{ github.event.number }}\n })\n let names = res.data.map((element) => element.name);\n\n // We've already visited this PR\n if (!names.includes('A-new-lint')) {\n // Check if we're with a new lint (there are 0 mentions of this lint on the codebase\n if (${{ env.LINT_CHANGELOG }} != \"\") {\n const lint_name = /\\[`(.*)`\\]/g.exec(${{ env.LINT_CHANGELOG }}).slice(1);\n let lint_name_upper = lint_name.toString().toUpperCase();\n let res = await octokit.rest.search.code({\n q: `${lint_name_upper} repo:rust-lang/rust-clippy`,\n per_page: 1,\n });\n \n if (res.data.items.length == 0) {\n await octokit.rest.issues.createComment({\n owner: \"blyxyas\",\n repo: \"rust-clippy\",\n issue_number: ${{ github.event.number }},\n body: \"Seems that you are trying to add a new lint! We are currently in a feature freeze, I'll add it to a milestone.\"\n });\n }\n }\n }\n```\n\n**Expected behavior**\nIt actually running and posting the comment as desired, it runs correctly on my local PC's Node\n\n**Desktop (please complete the following information):**\n - OS: ubuntu-latest\n - Version: Node 20, action/github-script@v7\n\n**Example**\n\nhttps://github.com/blyxyas/rust-clippy/actions/runs/14022377377/job/39255988671?pr=6","author":{"url":"https://github.com/blyxyas","@type":"Person","name":"blyxyas"},"datePublished":"2025-03-23T20:04:48Z","url":"https://github.com/actions/github-script/issues/567"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:346c5850-16f6-637f-3671-a1643cc1f13f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC12:2D40DE:23F7A98:2DD3745:6B01C39E |
| html-safe-nonce | d721eec32835e9a7b84098d4d1762f5aa30b47409190298f093587f6c5af7380 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzEyOjJENDBERToyM0Y3QTk4OjJERDM3NDU6NkIwMUMzOUUiLCJ2aXNpdG9yX2lkIjoiNDEwMjYwODUwMzAyMDA0NTIxNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bb5dc5933a051044aa88b88c3492ea6247d4ecebcfca0ae55da47fac57b3015d |
| hovercard-subject-tag | issue:2941452658 |
| github-keyboard-shortcuts | repository,issues,actions,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/actions/github-script/567/issue_layout |
| twitter:image | https://opengraph.githubassets.com/01e2d550291617c7eac645846d5f9403980d0147d1b3d304c677a3272684ace3/actions/github-script/issues/567 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/01e2d550291617c7eac645846d5f9403980d0147d1b3d304c677a3272684ace3/actions/github-script/issues/567 |
| og:image:alt | Describe the bug I've been testing very thoroughly some code that only has a Syntax Error on an actions/github-script@v7 run. To Reproduce The following script fails: Full file name: Clippy changel... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | blyxyas |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/actions/github-script git https://github.com/actions/github-script.git |
| octolytics-dimension-user_id | 44036562 |
| octolytics-dimension-user_login | actions |
| octolytics-dimension-repository_id | 205262760 |
| octolytics-dimension-repository_nwo | actions/github-script |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205262760 |
| octolytics-dimension-repository_network_root_nwo | actions/github-script |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width