|
13 | 13 | permissions: |
14 | 14 | actions: read |
15 | 15 | issues: read |
| 16 | + statuses: write |
16 | 17 | pull-requests: read |
17 | 18 | outputs: |
18 | 19 | uuid: ${{ steps.uuid.outputs.value }} |
|
22 | 23 | commit_email: ${{ steps.commit.outputs.email }} |
23 | 24 | percy_enable: ${{ steps.percy.outputs.value || '1' }} |
24 | 25 | steps: |
| 26 | + # We create the status here and then update it to success/failure in the `report` stage |
| 27 | + # This provides an easy link to this workflow_run from the PR before Cypress is done. |
| 28 | + - uses: Sibz/github-status-action@v1 |
| 29 | + with: |
| 30 | + authToken: ${{ secrets.GITHUB_TOKEN }} |
| 31 | + state: pending |
| 32 | + context: ${{ github.workflow }} / cypress (${{ github.event.workflow_run.event }} => ${{ github.event_name }}) |
| 33 | + sha: ${{ github.event.workflow_run.head_sha }} |
| 34 | + target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 35 | + |
25 | 36 | - id: prdetails |
26 | 37 | if: github.event.workflow_run.event == 'pull_request' |
27 | 38 | uses: matrix-org/pr-details-action@v1.2 |
|
62 | 73 | runs-on: ubuntu-latest |
63 | 74 | permissions: |
64 | 75 | actions: read |
65 | | - statuses: write |
66 | 76 | issues: read |
67 | 77 | pull-requests: read |
68 | 78 | environment: Cypress |
@@ -156,21 +166,21 @@ jobs: |
156 | 166 | if-no-files-found: ignore |
157 | 167 | retention-days: 1 |
158 | 168 |
|
159 | | - |
160 | | - # This job cannot have a pretty name due to https://github.com/haya14busa/action-workflow_run-status/issues/158 |
161 | | - cypress: |
| 169 | + report: |
| 170 | + name: Report results |
162 | 171 | needs: tests |
163 | 172 | runs-on: ubuntu-latest |
164 | 173 | if: always() |
165 | 174 | permissions: |
166 | 175 | statuses: write |
167 | 176 | steps: |
168 | | - # Wire up the status check for this workflow_run action |
169 | | - - uses: haya14busa/action-workflow_run-status@967ed83efa565c257675ed70cfe5231f062ddd94 # v1.0.0 |
170 | | - |
171 | | - - name: Check status |
172 | | - if: ${{ needs.tests.result != 'success' }} |
173 | | - run: exit 1 |
| 177 | + - uses: Sibz/github-status-action@v1 |
| 178 | + with: |
| 179 | + authToken: ${{ secrets.GITHUB_TOKEN }} |
| 180 | + state: ${{ needs.tests.result }} == 'success' && 'success' || 'failure' |
| 181 | + context: ${{ github.workflow }} / cypress (${{ github.event.workflow_run.event }} => ${{ github.event_name }}) |
| 182 | + sha: ${{ github.event.workflow_run.head_sha }} |
| 183 | + target_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
174 | 184 |
|
175 | 185 | store-benchmark: |
176 | 186 | needs: tests |
|
0 commit comments