There's a simpler way with more control, because
1) it's JavaScript, not a text-substituted curl command.
2) it uses GitHub API with auth built in.
3) first party GitHub Action
4) using checks.create rather then status.create for more control (output)
-name:"Createacheckrun"uses:actions/github-script@v6env:parameter_url:'${{github.event.workflow_run.html_url}}'with:debug:${{ secrets.ACTIONS_STEP_DEBUG || false }}script:|// any JavaScript code can go here, you can use Node JS APIs too.// Docs: https://docs.github.com/en/rest/checks/runs#create-a-check-run// Rest: https://octokit.github.io/rest.js/v18#checks-createawait github.rest.checks.create({owner: context.repo.owner,repo: context.repo.repo,head_sha: context.sha,name: "my-check-name",status: "completed",// Careful, code injection can happen.conclusion: "${{ github.event.workflow_run.conclusion }}",// This is safe, not string interpolation.details_url: process.env.parameter_url,output: {title: "my check title",summary: "my *check* summary",text: "my text",},});
and how it looks:
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There's a simpler way with more control, because
1) it's JavaScript, not a text-substituted curl command.
2) it uses GitHub API with auth built in.
3) first party GitHub Action
4) using checks.create rather then status.create for more control (output)
and how it looks: