ci: Skip release jobs on outdated tags

This happens a commit is pushed to main while the pipelines have not
finished for the previous commit. In this case the devel-tag pipelines
will run concurrently, leading to unpredictable results for the devel
release.
This commit is contained in:
Wolfgang Walther
2024-05-12 14:58:27 +02:00
parent aef29d49ba
commit 4a3fdc175c
+7 -2
View File
@@ -10,8 +10,9 @@ on:
- v*
concurrency:
# Terminate all previous runs of the same workflow for pull requests
group: ci-${{ github.head_ref || github.run_id }}
# Terminate all previous runs of the same workflow for the same tag, but never
# cancel for the main / release branch pipelines.
group: ci-${{ (github.ref_type == 'tag' && github.ref) || github.run_id }}
cancel-in-progress: true
jobs:
@@ -103,6 +104,10 @@ jobs:
tag:
name: Release / Tag
concurrency:
# Never tag outdated commits on the main branch by skipping superseded commits
group: ci-tag-${{ (github.ref == 'refs/heads/main' && github.ref) || github.run_id }}
cancel-in-progress: true
if: |
startsWith(github.ref, 'refs/heads/') &&
needs.docs.result == 'success' &&