my-check #6
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: Repository Dispatch | |
on: | |
repository_dispatch: | |
types: [my-check] | |
jobs: | |
myEvent: | |
runs-on: ubuntu-latest | |
steps: | |
#################################################### | |
# Update the status to show that the queued message | |
# was received and is being processed | |
#################################################### | |
- name: Acknowledge Request | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh api -X PATCH -H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-f 'status=in_progress' \ | |
-f 'output[title]=My Check Run Title 🤔' \ | |
-f 'output[summary]=A *fancy* summary' \ | |
-f 'output[images][][image_url]=https://www.kenmuse.com/favicon/apple-touch-icon.png' \ | |
-f 'output[images][][caption]=Sample from kenmuse.com' \ | |
-f 'output[images][][alt]=Logo for kenmuse.com' \ | |
/repos/${{ github.repository }}/check-runs/${{ github.event.client_payload.checkRunId }} | |
#################################################### | |
# Actually, we'll just sleep to simulate some work | |
#################################################### | |
- name: Processing | |
run: sleep 120 | |
##################################################### | |
# Send a final message to complete the run and | |
# provide any final updates. Doing this one in JSON | |
# to make it more readable. This approach can also | |
# be used to get total control over the serialized | |
# data types (for example, integers). | |
##################################################### | |
- name: Complete Check | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh api -X PATCH -H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/${{ github.repository }}/check-runs/${{ github.event.client_payload.checkRunId }} \ | |
--input - <<- EOF | |
{ | |
"conclusion": "success", | |
"details_url": "https://details.kenmuse.com", | |
"output": { | |
"title": "My Check Run Title 🚀", | |
"summary": "**Summary**: The run completed.", | |
"text": "Everything worked as expected. You should see a logo above." | |
} | |
} | |
EOF |