You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `run-workflow` | Whether to actually run the workflow or only make decision | No | `true` |
55
+
| `max-start-if-last-failed` | Maximum number of times to restart if last workflow run on last commit failed | No | `0` (disabled) |
56
+
| `commit-check-period` | Time window in days to check for recent commits | No | `1` |
55
57
56
58
## Outputs
57
59
@@ -64,9 +66,52 @@ jobs:
64
66
65
67
## Triggering Logic
66
68
67
-
1. If last commit in last 24 hours → Trigger
68
-
2. If last run was 7, 14, 21... days ago → Trigger (weekly check)
69
-
3. Otherwise → Skip
69
+
The action applies these rules in priority order:
70
+
71
+
1. **Restart on failure**: If `max-start-if-last-failed` is set and the last workflow run on the last commit failed/timed out/cancelled, and we haven't exceeded the max restart count → Trigger
72
+
2. **Recent commit**: If last commit is within `commit-check-period` days and no successful run exists on that commit → Trigger
73
+
3. **Weekly health check**: If last run was 7, 14, 21... days ago → Trigger (weekly check)
74
+
4. Otherwise → Skip
75
+
76
+
### Failure Restart Feature
77
+
78
+
The `max-start-if-last-failed` parameter allows automatic restarts when a workflow fails:
79
+
80
+
- Counts all workflow runs on the **last commit** of the branch
81
+
- If the most recent run failed/timed out/cancelled, triggers a new run
82
+
- Stops restarting once `max-start-if-last-failed` runs have been attempted
83
+
- If a successful run exists on the last commit, no restart is triggered
0 commit comments