-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use jq to properly format JSON output for check runs
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
- Loading branch information
1 parent
c5daa88
commit e4f431b
Showing
1 changed file
with
10 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,7 @@ jobs: | |
run: | | ||
HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}" | ||
# Create JSON payload file | ||
echo '{"title":"Success Check","summary":"This is a dummy success check."}' > output.json | ||
# Create check run with properly formatted JSON output | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
|
@@ -34,7 +32,10 @@ jobs: | |
-f status="completed" \ | ||
-f conclusion="success" \ | ||
-f details_url="https://www.google.com/search?q=success" \ | ||
-F [email protected] | ||
-f output="$(jq -n \ | ||
--arg title "Success Check" \ | ||
--arg summary "This is a dummy success check." \ | ||
'{title: $title, summary: $summary}')" | ||
failure_check: | ||
name: "Dummy Check (fail)" | ||
|
@@ -49,9 +50,7 @@ jobs: | |
run: | | ||
HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}" | ||
# Create JSON payload file | ||
echo '{"title":"Failure Check","summary":"This is a dummy failure check."}' > output.json | ||
# Create check run with properly formatted JSON output | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
|
@@ -62,4 +61,7 @@ jobs: | |
-f status="completed" \ | ||
-f conclusion="failure" \ | ||
-f details_url="https://www.google.com/search?q=failed" \ | ||
-F [email protected] | ||
-f output="$(jq -n \ | ||
--arg title "Failure Check" \ | ||
--arg summary "This is a dummy failure check." \ | ||
'{title: $title, summary: $summary}')" |