mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-05-17 04:52:23 +00:00
It is good practice to add concurrency limits to automatically cancel jobs that have been superceded and potentially stop race conditions if we try and get artifacts by workflows and job id rather than run id. See https://docs.zizmor.sh/audits/#concurrency-limits Assisted-by: IBM Bob Signed-off-by: stevenhorsman <steven@uk.ibm.com>
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
name: Skipper
|
|
|
|
# This workflow sets various "skip_*" output values that can be used to
|
|
# determine what workflows/jobs are expected to be executed. Sample usage:
|
|
#
|
|
# skipper:
|
|
# uses: ./.github/workflows/gatekeeper-skipper.yaml
|
|
# with:
|
|
# commit-hash: ${{ github.event.pull_request.head.sha }}
|
|
# target-branch: ${{ github.event.pull_request.base.ref }}
|
|
#
|
|
# your-workflow:
|
|
# needs: skipper
|
|
# if: ${{ needs.skipper.outputs.skip_build != 'yes' }}
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
commit-hash:
|
|
required: true
|
|
type: string
|
|
target-branch:
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
outputs:
|
|
skip_build:
|
|
value: ${{ jobs.skipper.outputs.skip_build }}
|
|
skip_test:
|
|
value: ${{ jobs.skipper.outputs.skip_test }}
|
|
skip_static:
|
|
value: ${{ jobs.skipper.outputs.skip_static }}
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-gatekeeper-skipper
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
skipper:
|
|
name: skipper
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
skip_build: ${{ steps.skipper.outputs.skip_build }}
|
|
skip_test: ${{ steps.skipper.outputs.skip_test }}
|
|
skip_static: ${{ steps.skipper.outputs.skip_static }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
ref: ${{ inputs.commit-hash }}
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
- id: skipper
|
|
env:
|
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
|
run: |
|
|
python3 tools/testing/gatekeeper/skips.py | tee -a "$GITHUB_OUTPUT"
|
|
shell: /usr/bin/bash -x {0}
|