mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-07 16:34:28 +01:00
Let's make sure we cancel previous runs, mainly as we have some of those that take a lot of time to run, whenever the PR is updated. This is based on the following stack overflow suggestion: https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre This is very much needed as we don't want to wait for a long time to have access to a runner because of other runners are still being used performing a task that's meaningless due to the PR update. Fixes: #7298 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
31 lines
1.0 KiB
YAML
31 lines
1.0 KiB
YAML
name: Kata Containers CI
|
|
on:
|
|
pull_request_target:
|
|
branches:
|
|
- 'main'
|
|
types:
|
|
# Adding 'labeled' to the list of activity types that trigger this event
|
|
# (default: opened, synchronize, reopened) so that we can run this
|
|
# workflow when the 'ok-to-test' label is added.
|
|
# Reference: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
- labeled
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
kata-containers-ci-on-push:
|
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }}
|
|
uses: ./.github/workflows/ci.yaml
|
|
with:
|
|
commit-hash: ${{ github.event.pull_request.head.sha }}
|
|
pr-number: ${{ github.event.pull_request.number }}
|
|
tag: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
|
|
secrets: inherit
|