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* - v*
concurrency: concurrency:
# Terminate all previous runs of the same workflow for pull requests # Terminate all previous runs of the same workflow for the same tag, but never
group: ci-${{ github.head_ref || github.run_id }} # cancel for the main / release branch pipelines.
group: ci-${{ (github.ref_type == 'tag' && github.ref) || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
@@ -103,6 +104,10 @@ jobs:
tag: tag:
name: Release / 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: | if: |
startsWith(github.ref, 'refs/heads/') && startsWith(github.ref, 'refs/heads/') &&
needs.docs.result == 'success' && needs.docs.result == 'success' &&