-
Notifications
You must be signed in to change notification settings - Fork 7
46 lines (41 loc) · 1.54 KB
/
dummy_check_result.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Dummy Check Result
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/dummy_check_result.yml'
jobs:
test_check:
name: "Test Check"
runs-on: ubuntu-22.04
permissions:
checks: write
contents: read
steps:
- name: Create Check Run
env:
GH_TOKEN: ${{ github.token }}
run: |
HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
# Create check run with custom details URL
response=$(gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
repos/${{ github.repository }}/check-runs \
-f name="Test Results (Direct API)" \
-f head_sha="$HEAD_SHA" \
-f status="completed" \
-f conclusion="failure" \
-f details_url="https://www.google.com/search?q=test-failure" \
-f output='{"title":"Test Results","summary":"This is a test check using direct API calls."}')
# Get the check run ID
check_id=$(echo "$response" | jq -r '.id')
echo "Created check run ID: $check_id"
# Verify the check run details
echo "Verifying check run details..."
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
repos/${{ github.repository }}/check-runs/$check_id | jq '{name, details_url, html_url, status, conclusion}'