bakdata / ci-templates

Collection of reusable workflows and composite actions for Github
MIT License
4 stars 1 forks source link

Add concurrency to our workflows #158

Closed yannick-roeder closed 10 months ago

yannick-roeder commented 11 months ago

Ideally the previous workflow is cancelled when the newer workflow is already running. This can be achieved with workflow concurrency. Adding this to every workflow should be sufficient:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-docker
  cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }}

Note that the suffix of the group is always specific to the workflow to avoid that different workflows cancel each other in the same run.