mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-26 08:10:20 +00:00
ci: only add /test ..
comment if the branch for the PR matches
By adding an if-statement for each step of the matrix job, only those steps are executed where the base ref of the PR matches the branch in the matrix parameters. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
parent
2d120f2e10
commit
ee843e6ffd
19
.github/workflows/pull-request-commentor.yaml
vendored
19
.github/workflows/pull-request-commentor.yaml
vendored
@ -21,25 +21,15 @@ jobs:
|
|||||||
branch: [release-v3.8, release-v3.9, devel]
|
branch: [release-v3.8, release-v3.9, devel]
|
||||||
k8s: ["1.25", "1.26", "1.27", "1.28"]
|
k8s: ["1.25", "1.26", "1.27", "1.28"]
|
||||||
exclude:
|
exclude:
|
||||||
# The exclude items below are dynamically constructed. If the
|
|
||||||
# base_ref matches the given branch, it will be excluded from the
|
|
||||||
# test matrix.
|
|
||||||
|
|
||||||
# the next Ceph-CSI version will not be tested with old Kubernetes
|
# the next Ceph-CSI version will not be tested with old Kubernetes
|
||||||
- k8s: "1.25"
|
- k8s: "1.25"
|
||||||
branch: >
|
branch: "devel"
|
||||||
${{ "devel" == github.base_ref
|
|
||||||
&& github.base_ref || "no-exclude" }}
|
|
||||||
|
|
||||||
# Ceph-CSI <= 3.9 was released before Kubernetes 1.28
|
# Ceph-CSI <= 3.9 was released before Kubernetes 1.28
|
||||||
- k8s: "1.28"
|
- k8s: "1.28"
|
||||||
branch: >
|
branch: "release-v3.8"
|
||||||
${{ "release-v3.8" == github.base_ref
|
|
||||||
&& github.base_ref || "no-exclude" }}
|
|
||||||
- k8s: "1.28"
|
- k8s: "1.28"
|
||||||
branch: >
|
branch: "release-v3.9"
|
||||||
${{ "release-v3.9" == github.base_ref
|
|
||||||
&& github.base_ref || "no-exclude" }}
|
|
||||||
|
|
||||||
# watch out, matrix.branch can not be used in this if-statement :-/
|
# watch out, matrix.branch can not be used in this if-statement :-/
|
||||||
if: >
|
if: >
|
||||||
@ -50,6 +40,7 @@ jobs:
|
|||||||
- name: >
|
- name: >
|
||||||
Add comment to trigger external storage tests for Kubernetes
|
Add comment to trigger external storage tests for Kubernetes
|
||||||
${{ matrix.k8s }}
|
${{ matrix.k8s }}
|
||||||
|
if: ${{ github.base_ref == matrix.branch }}
|
||||||
uses: peter-evans/create-or-update-comment@v3
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CEPH_CSI_BOT_TOKEN }}
|
token: ${{ secrets.CEPH_CSI_BOT_TOKEN }}
|
||||||
@ -60,6 +51,7 @@ jobs:
|
|||||||
- name: >
|
- name: >
|
||||||
Add comment to trigger helm E2E tests for Kubernetes
|
Add comment to trigger helm E2E tests for Kubernetes
|
||||||
${{ matrix.k8s }}
|
${{ matrix.k8s }}
|
||||||
|
if: ${{ github.base_ref == matrix.branch }}
|
||||||
uses: peter-evans/create-or-update-comment@v3
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CEPH_CSI_BOT_TOKEN }}
|
token: ${{ secrets.CEPH_CSI_BOT_TOKEN }}
|
||||||
@ -69,6 +61,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Add comment to trigger E2E tests for Kubernetes ${{ matrix.k8s }}
|
- name: Add comment to trigger E2E tests for Kubernetes ${{ matrix.k8s }}
|
||||||
uses: peter-evans/create-or-update-comment@v3
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
|
if: ${{ github.base_ref == matrix.branch }}
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CEPH_CSI_BOT_TOKEN }}
|
token: ${{ secrets.CEPH_CSI_BOT_TOKEN }}
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
Loading…
Reference in New Issue
Block a user