forked from Ikalus1988/MisakaNet
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) 路 1.41 KB
/
Copy pathci-self-heal.yml
File metadata and controls
49 lines (44 loc) 路 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: CI Self-Heal
on:
workflow_call:
inputs:
command:
description: 'Command to run with retry'
required: true
type: string
max_attempts:
description: 'Max retry attempts'
required: false
type: string
default: '3'
backoff:
description: 'Backoff strategy'
required: false
type: string
default: 'exponential'
jobs:
self-heal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Run with retry
id: retry
uses: ./.github/actions/retry/
with:
run: ${{ inputs.command }}
max_attempts: ${{ inputs.max_attempts }}
backoff: ${{ inputs.backoff }}
- name: Classify failure (if failed)
id: classify
if: failure() && steps.retry.outputs.final_exit_code != '0'
uses: ./.github/actions/classify-failure/
with:
log_file: ${{ github.workspace }}/.retry-output.log
exit_code: ${{ steps.retry.outputs.final_exit_code }}
- name: Notify on exhaustion
if: failure() && steps.classify.outputs.should_retry == 'false'
uses: ./.github/actions/notify-failure/
with:
failure_class: ${{ steps.classify.outputs.failure_class }}
failure_summary: ${{ steps.classify.outputs.failure_summary }}
attempts_count: ${{ steps.retry.outputs.attempts_count }}