Skip to content

Commit 427098f

Browse files
committed
Add a step in each jobs to prevent re-running the job
if it has already been executed once, we don't want to re-run it again as this would mess up version.txt and the release process. New builds needs to be triggered manually.
1 parent 2c03238 commit 427098f

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Prevent Workflow Re-run
2+
description: Fails if the workflow is re-run (github.run_attempt > 1)
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Prevent any re-run
7+
if: ${{ github.run_attempt > 1 }}
8+
run: |
9+
echo "::error::Re-running jobs is not permitted. Please trigger a new build manually at https://github.com/quarto-dev/quarto-cli/actions/workflows/create-release.yml (click 'Run workflow'), or use the GitHub CLI: `gh workflow run create-release.yml`"
10+
exit 1
11+
shell: bash

.github/workflows/create-release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
tag_pushed: ${{ steps.version_commit.outputs.tag_pushed }}
3232
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'quarto-dev/quarto-cli')
3333
steps:
34+
- name: Prevent Re-run
35+
uses: ./.github/actions/prevent-rerun
36+
3437
- uses: actions/checkout@v4
3538
with:
3639
fetch-depth: 0
@@ -95,6 +98,9 @@ jobs:
9598
runs-on: ubuntu-latest
9699
needs: [configure]
97100
steps:
101+
- name: Prevent Re-run
102+
uses: ./.github/actions/prevent-rerun
103+
98104
- uses: actions/checkout@v4
99105
with:
100106
ref: ${{ needs.configure.outputs.version_commit }}
@@ -113,6 +119,9 @@ jobs:
113119
runs-on: ubuntu-latest
114120
needs: [configure]
115121
steps:
122+
- name: Prevent Re-run
123+
uses: ./.github/actions/prevent-rerun
124+
116125
- uses: actions/checkout@v4
117126
with:
118127
ref: ${{ needs.configure.outputs.version_commit }}
@@ -146,6 +155,9 @@ jobs:
146155
runs-on: ubuntu-latest
147156
needs: [configure]
148157
steps:
158+
- name: Prevent Re-run
159+
uses: ./.github/actions/prevent-rerun
160+
149161
- uses: actions/checkout@v4
150162
with:
151163
ref: ${{ needs.configure.outputs.version_commit }}
@@ -179,6 +191,9 @@ jobs:
179191
runs-on: ubuntu-latest
180192
needs: [configure]
181193
steps:
194+
- name: Prevent Re-run
195+
uses: ./.github/actions/prevent-rerun
196+
182197
- uses: actions/checkout@v4
183198
with:
184199
ref: ${{ needs.configure.outputs.version_commit }}
@@ -223,6 +238,9 @@ jobs:
223238
runs-on: ubuntu-latest
224239
needs: [configure]
225240
steps:
241+
- name: Prevent Re-run
242+
uses: ./.github/actions/prevent-rerun
243+
226244
- uses: actions/checkout@v4
227245
with:
228246
ref: ${{ needs.configure.outputs.version_commit }}
@@ -253,6 +271,9 @@ jobs:
253271
runs-on: ubuntu-latest
254272
needs: [configure]
255273
steps:
274+
- name: Prevent Re-run
275+
uses: ./.github/actions/prevent-rerun
276+
256277
- uses: actions/checkout@v4
257278
with:
258279
ref: ${{ needs.configure.outputs.version_commit }}
@@ -283,6 +304,9 @@ jobs:
283304
runs-on: ubuntu-latest
284305
needs: [configure, make-tarball]
285306
steps:
307+
- name: Prevent Re-run
308+
uses: ./.github/actions/prevent-rerun
309+
286310
- uses: actions/download-artifact@v4
287311
with:
288312
name: Deb Zip
@@ -303,6 +327,9 @@ jobs:
303327
needs: [configure]
304328

305329
steps:
330+
- name: Prevent Re-run
331+
uses: ./.github/actions/prevent-rerun
332+
306333
- name: Configure Rust Tools
307334
run: |
308335
rustup.exe toolchain install 1.63.0 --component rustfmt --component clippy --no-self-update
@@ -383,6 +410,9 @@ jobs:
383410
runs-on: windows-latest
384411
needs: [configure, make-installer-win]
385412
steps:
413+
- name: Prevent Re-run
414+
uses: ./.github/actions/prevent-rerun
415+
386416
- uses: actions/download-artifact@v4
387417
with:
388418
name: Windows Zip
@@ -399,6 +429,9 @@ jobs:
399429
runs-on: macos-latest
400430
needs: [configure]
401431
steps:
432+
- name: Prevent Re-run
433+
uses: ./.github/actions/prevent-rerun
434+
402435
- uses: actions/checkout@v4
403436
with:
404437
ref: ${{ needs.configure.outputs.version_commit }}
@@ -464,6 +497,9 @@ jobs:
464497
runs-on: macos-latest
465498
needs: [configure, make-installer-mac]
466499
steps:
500+
- name: Prevent Re-run
501+
uses: ./.github/actions/prevent-rerun
502+
467503
- uses: actions/download-artifact@v4
468504
with:
469505
name: Mac Zip
@@ -499,6 +535,9 @@ jobs:
499535
]
500536

501537
steps:
538+
- name: Prevent Re-run
539+
uses: ./.github/actions/prevent-rerun
540+
502541
- name: Download Artifacts
503542
uses: actions/download-artifact@v4
504543

@@ -599,6 +638,9 @@ jobs:
599638
]
600639
runs-on: ubuntu-latest
601640
steps:
641+
- name: Prevent Re-run
642+
uses: ./.github/actions/prevent-rerun
643+
602644
- uses: actions/checkout@v4
603645

604646
- name: Revert commit of version.txt
@@ -623,6 +665,9 @@ jobs:
623665
runs-on: ubuntu-latest
624666
needs: [configure, publish-release]
625667
steps:
668+
- name: Prevent Re-run
669+
uses: ./.github/actions/prevent-rerun
670+
626671
- name: Download Artifacts
627672
uses: actions/download-artifact@v4
628673

0 commit comments

Comments
 (0)