CI/GHA: cancel outdated CI runs on new PR changes

Avoid letting outdated CI runs continue if a PR receives
new changes. Outside a PR we let them continue running
by tying the concurrency to the commit hash instead.

Also only let one CodeQL or Hacktoberfest job run at a time.

Other CI platforms we use have this build in, but GitHub
unfortunately neither by default nor with a simple option.

This saves CI resources and therefore a little energy.

Approved-by: Daniel Stenberg
Approved-by: Max Dymond
Closes #9533
This commit is contained in:
Marc Hoersken 2022-09-17 23:45:32 +02:00
parent fda897f5a1
commit 4e6893307b
No known key found for this signature in database
GPG key ID: 61E03CBED7BC859E
14 changed files with 62 additions and 23 deletions

View file

@ -5,8 +5,6 @@
name: CodeQL
on:
# Trigger the workflow on push or pull requests, but only for the
# master branch
push:
branches:
- master
@ -17,6 +15,9 @@ on:
schedule:
- cron: '0 0 * * 4'
concurrency:
group: ${{ github.workflow }}
permissions:
security-events: write