Trigger CI when public PR is approved

This commit is contained in:
Dusan Figala 2023-03-07 11:21:01 +01:00 committed by Daniel Tipping
parent 6e24fac103
commit 1dfa419c44
1 changed files with 9 additions and 3 deletions

View File

@ -10,15 +10,20 @@ on:
- '**'
# Trigger the workflow on pull request
pull_request_target: ~
pull_request: ~
# Trigger the workflow manually
workflow_dispatch: ~
# Trigger after public PR approved for CI
pull_request_target:
types: [labeled]
jobs:
# Run CI including downstream packages on self-hosted runners
downstream-ci:
name: downstream-ci
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main
with:
eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}
@ -28,7 +33,7 @@ jobs:
private-downstream-ci:
name: private-downstream-ci
needs: [downstream-ci]
if: success() || failure()
if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
@ -45,6 +50,7 @@ jobs:
# Build downstream packages on HPC
downstream-ci-hpc:
name: downstream-ci-hpc
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
with:
eccodes: ecmwf/eccodes@${{ github.event.pull_request.head.sha || github.sha }}
@ -54,7 +60,7 @@ jobs:
private-downstream-ci-hpc:
name: private-downstream-ci-hpc
needs: [downstream-ci-hpc]
if: success() || failure()
if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
runs-on: ubuntu-latest
permissions:
pull-requests: write