fix copy paste #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing | |
on: | |
push: | |
branches: [ "**" ] | |
jobs: | |
tests: | |
name: Testing | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: write | |
issues: read | |
pull-requests: read | |
checks: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
depth: 0 | |
- name: Get the head SHA | |
id: get_head | |
if: ${{ always() }} | |
run: echo "##[set-output name=HEAD;]$(git rev-parse HEAD)" | |
- name: "Create a check run" | |
uses: actions/github-script@v6 | |
id: create_check | |
env: | |
sha: '${{ steps.get_head.outputs.HEAD }}' | |
owner: 'sublime-security' | |
repo: 'sublime-rules' | |
with: | |
debug: ${{ secrets.ACTIONS_STEP_DEBUG || false }} | |
retries: 3 | |
# Default includes 422 which GitHub returns when it doesn't know about the head_sha we set the status for. | |
# This occurs when the previous push succeeds, but the checks/pull request component of GitHub isn't yet aware | |
# of the new commit. This isn't the common case, but it comes up enough to be annoying. | |
retry-exempt-status-codes: 400, 401, 403, 404 | |
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-create | |
const response = await github.rest.checks.create({ | |
owner: "sublime-security", | |
repo: "sublime-rules", | |
head_sha: process.env.sha, | |
name: "MQL Mimic Tests", | |
status: "in_progress", | |
output: { | |
title: "MQL Mimic Tests", | |
summary: "MQL Mimic tests are Running", | |
text: "MQL Mimic tests are Running. URL: " + process.env.run_url, | |
}, | |
}); | |
return response["data"]["id"] | |