Skip to content
Snippets Groups Projects
Commit f76c600c authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Yaroslav Lobankov
Browse files

ci: cancel publishing workflow run when outdated

See d3f32d18 for explanation.

NO_CHANGELOG=ci
NO_DOC=ci
NO_TEST=ci
parent 34a7f1ec
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,26 @@ on: ...@@ -7,6 +7,26 @@ on:
types: [opened, reopened, synchronize, labeled] types: [opened, reopened, synchronize, labeled]
workflow_dispatch: workflow_dispatch:
concurrency:
# Update of a developer branch cancels the previously scheduled workflow
# run for this branch. However, the 'master' branch, release branch (1.10,
# 2.8, etc.), and tag workflow runs are never canceled.
#
# We use a trick here: define the concurrency group as 'workflow run ID' +
# 'workflow run attempt' because it is a unique combination for any run.
# So it effectively discards grouping.
#
# Important: we cannot use `github.sha` as a unique identifier because
# pushing a tag may cancel a run that works on a branch push event.
group: ${{ (
github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/1.10' ||
startsWith(github.ref, 'refs/heads/2.') ||
startsWith(github.ref, 'refs/tags/')) &&
format('{0}-{1}', github.run_id, github.run_attempt) ||
format('{0}-{1}', github.workflow, github.ref) }}
cancel-in-progress: true
jobs: jobs:
publish-api-doc: publish-api-doc:
# Run on push to the branch 'master' or on pull request if the 'full-ci' # Run on push to the branch 'master' or on pull request if the 'full-ci'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment