Ajout d'un auto retry
This commit is contained in:
parent
f0fd66f4b2
commit
37a59c23c3
1 changed files with 26 additions and 0 deletions
26
.github/workflows/auto-retry.yml
vendored
Normal file
26
.github/workflows/auto-retry.yml
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
name: Auto-Retry on Timeout
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Deploy to Cloudflare Pages"]
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
retry-job:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled' }}
|
||||||
|
permissions:
|
||||||
|
actions: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Relancer le workflow si moins de 3 essais
|
||||||
|
if: ${{ github.event.workflow_run.run_attempt < 3 }}
|
||||||
|
run: |
|
||||||
|
echo "Le workflow précédent a échoué ou a duré trop longtemps. Relance automatique..."
|
||||||
|
gh workflow run "${{ github.event.workflow_run.workflow_id }}" --ref "${{ github.event.workflow_run.head_branch }}"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Ne pas relancer (Trop d'essais)
|
||||||
|
if: ${{ github.event.workflow_run.run_attempt >= 3 }}
|
||||||
|
run: echo "Déjà 3 tentatives échouées. On arrête pour éviter une boucle infinie."
|
||||||
Loading…
Add table
Add a link
Reference in a new issue