Skip to content

Commit 230b08f

Browse files
CLOUDP-304706: add a retry step to the FOAS release process
1 parent ee01c85 commit 230b08f

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

.github/workflows/release-spec.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,20 @@ jobs:
184184
branch: ${{ inputs.branch }}
185185
foascli_version: ${{ inputs.foascli_version }}
186186

187-
failure-handler:
188-
name: Failure Handler
187+
retry-handler:
189188
needs: [ release, release-postman, release-changelog]
190-
if: ${{ always() && contains(needs.*.result, 'failure') }}
189+
if: ${{ always() && contains(needs.*.result, 'failure') && fromJSON(github.run_attempt) < 3}}
190+
runs-on: ubuntu-latest
191+
steps:
192+
- env:
193+
GH_REPO: ${{ github.repository }}
194+
GH_TOKEN: ${{ secrets.api_bot_pat }}
195+
run: gh workflow run retry-handler.yml -F run_id=${{ github.run_id }}
196+
197+
failure-handler:
198+
name: Failure Handler
199+
needs: [retry-handler, release, release-postman, release-changelog]
200+
if: ${{ always() && contains(needs.*.result, 'failure') && needs.retry-handler.result == 'skipped' }}
191201
uses: ./.github/workflows/failure-handler.yml
192202
with:
193203
env: ${{ inputs.env }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Retry failures in the Release Workflow'
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
run_id:
6+
required: true
7+
description: 'The ID of the workflow to rerun.'
8+
type: string
9+
jobs:
10+
rerun:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: rerun ${{ inputs.run_id }}
14+
env:
15+
GH_REPO: ${{ github.repository }}
16+
GH_TOKEN: ${{ github.token }}
17+
GH_DEBUG: api
18+
run: |
19+
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
20+
gh run rerun ${{ inputs.run_id }} --failed

0 commit comments

Comments
 (0)