Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/release-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,20 @@ jobs:
branch: ${{ inputs.branch }}
foascli_version: ${{ inputs.foascli_version }}

failure-handler:
name: Failure Handler
retry-handler:
needs: [ release, release-postman, release-changelog]
if: ${{ always() && contains(needs.*.result, 'failure') }}
if: ${{ always() && contains(needs.*.result, 'failure') && fromJSON(github.run_attempt) < 3}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: does GH actions not have some standard support for retries? would be nice if we didn't have to maintain our own retry logic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some 3rd party Actions but they don't allow to restart a complete worflow. Let me know if you find something! we can always update this logic

runs-on: ubuntu-latest
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.api_bot_pat }}
run: gh workflow run retry-handler.yml -F run_id=${{ github.run_id }}

failure-handler:
name: Failure Handler
needs: [retry-handler, release, release-postman, release-changelog]
if: ${{ always() && contains(needs.*.result, 'failure') && needs.retry-handler.result == 'skipped' }}
uses: ./.github/workflows/failure-handler.yml
with:
env: ${{ inputs.env }}
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/retry-handler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Retry failures in the Release Workflow'
on:
workflow_dispatch:
inputs:
run_id:
required: true
description: 'The ID of the workflow to rerun.'
type: string
jobs:
rerun:
runs-on: ubuntu-latest
steps:
- name: rerun ${{ inputs.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed
Loading