Skip to content

Commit

Permalink
Add support for external id and output inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
rvermeulen committed Sep 8, 2023
1 parent 6b771ab commit 686ce44
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/update-check-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ on:
description: |
The URL of the integrator's site that has the full details of the check.
type: string
external_id:
description: |
A reference for the run on the integrator's system.
type: string
output:
description: |
The output object for the check run.
See https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#update-a-check-run for more information.
type: string
default: '{}'

permissions:
checks: write
Expand All @@ -39,13 +50,17 @@ jobs:
CHECK_RUN_STATUS: ${{ inputs.status }}
CHECK_RUN_CONCLUSION: ${{ inputs.conclusion }}
CHECK_RUN_DETAILS_URL: ${{ inputs.details_url }}
CHECK_RUN_EXTERNAL_ID: ${{ inputs.external_id }}
CHECK_RUN_OUTPUT: ${{ inputs.output }}
GITHUB_TOKEN: ${{ github.token }}
run: |
jq -n \
--arg status "$CHECK_RUN_STATUS" \
--arg conclusion "$CHECK_RUN_CONCLUSION" \
--arg details_url "$CHECK_RUN_DETAILS_URL" \
'{status: $status, conclusion: $conclusion, details_url: $details_url} | to_entries | map(select(.value != "")) | from_entries' \
--arg external_id "$CHECK_RUN_EXTERNAL_ID" \
--argjson output "$CHECK_RUN_OUTPUT" \
'{status: $status, conclusion: $conclusion, details_url: $details_url, external_id: $external_id, output: $output} | to_entries | map(select(.value != "" and .value != {})) | from_entries' \
| \
gh api \
--method PATCH \
Expand Down

0 comments on commit 686ce44

Please sign in to comment.