ci: skip CI for draft and WIP PRs
Let only the init stage run so that we have a link on PRs to the CI and can trigger it manually if desired. PR template updated with this info. Also use yaml anchors for rules to reduce duplication.
This commit is contained in:
parent
ae07093404
commit
ba4f49078a
3 changed files with 51 additions and 38 deletions
4
.github/workflows/trigger-gitlab.yml
vendored
4
.github/workflows/trigger-gitlab.yml
vendored
|
|
@ -13,7 +13,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
env:
|
||||
SCHUTZBOT_SSH_KEY: ${{ secrets.SCHUTZBOT_SSH_KEY }}
|
||||
SKIP_CI: ${{ github.event.pull_request.draft == true || contains(github.event.pull_request.labels.*.name, 'WIP') }}
|
||||
SKIP_CI: ${{ (github.event.pull_request.draft == true || contains(github.event.pull_request.labels.*.name, 'WIP')) && !contains(github.event.pull_request.labels.*.name, 'WIP+test') }}
|
||||
steps:
|
||||
- name: Report status
|
||||
uses: haya14busa/action-workflow_run-status@v1
|
||||
|
|
@ -59,5 +59,5 @@ jobs:
|
|||
touch ~/.ssh/known_hosts
|
||||
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
|
||||
git remote add ci git@gitlab.com:osbuild/ci/osbuild-composer.git
|
||||
[[ "${SKIP_CI}" == true ]] && PUSH_OPTION="-o ci.skip" || PUSH_OPTION=""
|
||||
[[ "${SKIP_CI}" == true ]] && PUSH_OPTION='-o ci.variable="SKIP_CI=true"' || PUSH_OPTION=""
|
||||
git push -f ${PUSH_OPTION} ci
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue