|
14 | 14 | if: github.event.workflow_run.conclusion == 'success' |
15 | 15 |
|
16 | 16 | 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 | + |
17 | 30 | - name: Checkout code |
18 | 31 | uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 |
19 | 32 | with: |
@@ -99,3 +112,17 @@ jobs: |
99 | 112 | files: .vortex/docs/.logs/cobertura.xml |
100 | 113 | fail_ci_if_error: true |
101 | 114 | 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