Skip to content

Commit 81a3fd5

Browse files
committed
Fixed GHA status check for vortex-test-docs workflow.
1 parent 7763162 commit 81a3fd5

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/vortex-test-docs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ jobs:
1414
if: github.event.workflow_run.conclusion == 'success'
1515

1616
steps:
17+
# Post pending status to the PR commit.
18+
# Workflows triggered by workflow_run don't automatically report status
19+
# on the triggering PR, so we need to do it manually.
20+
- name: Set pending commit status
21+
run: |
22+
gh api repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_sha }} \
23+
-f state=pending \
24+
-f context="Vortex - Test docs" \
25+
-f description="Running documentation tests..." \
26+
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
27+
env:
28+
GH_TOKEN: ${{ github.token }}
29+
1730
- name: Checkout code
1831
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1932
with:
@@ -99,3 +112,17 @@ jobs:
99112
files: .vortex/docs/.logs/cobertura.xml
100113
fail_ci_if_error: true
101114
token: ${{ secrets.CODECOV_TOKEN }}
115+
116+
# Post final status to the PR commit.
117+
- name: Set final commit status
118+
if: always()
119+
run: |
120+
state=${{ job.status == 'success' && 'success' || 'failure' }}
121+
description=${{ job.status == 'success' && '"Documentation tests passed"' || '"Documentation tests failed"' }}
122+
gh api repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_sha }} \
123+
-f state="${state}" \
124+
-f context="Vortex - Test docs" \
125+
-f description="${description}" \
126+
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
127+
env:
128+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)