[bitnami/*] Disable CI in closed PRs (#11302)

* Disable CI in closed PRs. Also on 'labeled' events we take care only about 'verify' label

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Apply suggestions to keep running get-charts on opened requests without labels

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Update .github/workflows/ci-pipeline.yaml

Signed-off-by: Fran Mulero <fmulero@vmware.com>

Co-authored-by: Jose Antonio Carmona <joancafom@icloud.com>

* Update .github/workflows/ci-pipeline.yaml

Signed-off-by: Fran Mulero <fmulero@vmware.com>

Co-authored-by: Jose Antonio Carmona <joancafom@icloud.com>

* Apply suggestions

Signed-off-by: Fran Mulero <fmulero@vmware.com>

Co-authored-by: Jose Antonio Carmona <joancafom@icloud.com>
This commit is contained in:
Fran Mulero
2022-07-21 18:57:22 +02:00
committed by GitHub
parent 3cc0b9ba22
commit 091a6dabcf

View File

@@ -17,6 +17,7 @@ jobs:
get-chart:
runs-on: ubuntu-latest
name: 'Get modified charts'
if: ${{ github.event.pull_request.state != 'closed' }}
outputs:
chart: ${{ steps.get-chart.outputs.chart }}
result: ${{ steps.get-chart.outputs.result }}
@@ -89,14 +90,16 @@ jobs:
needs: get-chart
# Given performance issues of the action feature on GH's side, we need to be very restrictive in the job's triggers:
# -> The 'Get modified charts' job suceededs AND
# -> The event action is different from opened AND
# -> The event is not opened (avoids running twice on consecutive opened and labeled events) AND
# ( ---> The pipeline was triggered due to a label addition and said label was the 'verify' one OR
# ---> The pipeline was NOT triggered due to a label addition but the PR already contains the 'verify' one )
if: |
needs.get-chart.outputs.result == 'ok' &&
github.event.action != 'opened' &&
(github.event.action == 'labeled' && github.event.label.name == 'verify' ||
github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'verify'))
(
(github.event.action == 'labeled' && github.event.label.name == 'verify') ||
(github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'verify'))
)
name: VIB Verify
steps:
- uses: actions/checkout@v2