diff --git a/.github/workflows/ls1_format.yml b/.github/workflows/ls1_format.yml index a466d4fd7..d6dfcc103 100644 --- a/.github/workflows/ls1_format.yml +++ b/.github/workflows/ls1_format.yml @@ -46,8 +46,8 @@ jobs: uses: actions/github-script@v7 with: script: | - var fs = require('fs'); - var pr_number = Number(fs.readFileSync('./NR')); + const { context, github } = require('@actions/github'); + const pr_number = context.issue.number; await github.rest.issues.createComment({ issue_number: pr_number, owner: context.repo.owner, @@ -55,7 +55,7 @@ jobs: body: ':warning: The CI detected formatting issues in this pull request. ' + 'Please run clang-format locally to resolve them.\n' + 'Details are shown in the [job log](https://github.com/' - + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + ${{ github.event.workflow_run.id }} + ').' + + context.repo.owner + '/' + context.repo.repo + '/actions/runs/' + context.runId + ').' }); - name: Exit with failure if clang-format found issues