Skip to content

Commit 364e695

Browse files
committed
👷 Automatic GHA workflow step retry
1 parent e12649d commit 364e695

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/heads.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ jobs:
7979
# NOTE: This does not use the primary Gemfile at all.
8080
- name: Install Root Appraisal
8181
run: bundle
82-
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
82+
83+
- name: [Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
84+
id: bundleAttempt1
85+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
86+
# Continue to the next step on failure
87+
continue-on-error: true
88+
89+
# Effectively an automatic retry of the previous step.
90+
- name: [Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
91+
id: bundleAttempt2
92+
# If bundleAttempt1 failed, try again here; Otherwise skip.
93+
if: steps.bundleAttempt1.outcome == 'failure'
8394
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
95+
8496
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
8597
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

0 commit comments

Comments
 (0)