-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: switch to commit status API for custom URLs
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
- Loading branch information
1 parent
8ef33b7
commit 4879558
Showing
1 changed file
with
16 additions
and
18 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Dummy Check Result | ||
name: Dummy Commit Status | ||
|
||
on: | ||
pull_request: | ||
|
@@ -8,25 +8,23 @@ on: | |
- '.github/workflows/dummy_check_result.yml' | ||
|
||
jobs: | ||
failure_check: | ||
name: "Dummy Check (fail)" | ||
failure_status: | ||
name: "Dummy Status (fail)" | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
checks: write | ||
contents: read | ||
contents: write # Required for creating commit statuses | ||
steps: | ||
- name: Create Failure Check Run | ||
uses: LouisBrunner/[email protected] | ||
- name: Create Failure Status | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} | ||
with: | ||
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} | ||
name: "Dummy Check (fail custom)" | ||
status: completed | ||
conclusion: failure | ||
details_url: "https://www.google.com/search?q=failed" | ||
output: | | ||
{ | ||
"title": "Test Report", | ||
"summary": "This is a dummy failure check.\nHTML Report URL: https://www.google.com/search?q=failed" | ||
} | ||
run: | | ||
HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}" | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
repos/${{ github.repository }}/statuses/$HEAD_SHA \ | ||
-f state="failure" \ | ||
-f target_url="https://www.google.com/search?q=failed" \ | ||
-f description="Click Details to view the test report" \ | ||
-f context="Test Report: Dummy Connector" |