Skip to content

Commit 7a22622

Browse files
nixpanicceph-csi-bot
authored andcommitted
ci: add repository check to workflows using secrets
Add 'if: github.repository == "ceph/ceph-csi"' condition to workflows that use GitHub secrets to ensure they only run in the upstream repository: - mergify-copy-labels.yaml: Added check to job using CEPH_CSI_BOT_TOKEN - publish-docs.yaml: Added check to deploy job using CEPH_CSI_BOT_NAME/EMAIL - pull-request-commentor.yaml: Added check to job using CEPH_CSI_BOT_TOKEN This prevents workflows from attempting to use secrets in forks where they are not available, avoiding workflow failures. Assisted-by: AskBob <askbob@ibm.com> Signed-off-by: Niels de Vos <ndevos@ibm.com>
1 parent 5a32810 commit 7a22622

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

.github/workflows/mergify-copy-labels.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ concurrency:
1515

1616
jobs:
1717
mergify-merge-queue-labels-copier:
18+
if: github.repository == 'ceph/ceph-csi'
1819
runs-on: ubuntu-latest
1920
steps:
2021
- name: Copying labels

.github/workflows/publish-docs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ permissions:
1616

1717
jobs:
1818
deploy:
19+
if: github.repository == 'ceph/ceph-csi'
1920
runs-on: ubuntu-latest
2021
steps:
2122
# yamllint disable-line rule:line-length

.github/workflows/pull-request-commentor.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242

4343
# watch out, matrix.branch can not be used in this if-statement :-/
4444
if: >
45+
github.repository == 'ceph/ceph-csi' &&
4546
(github.event.label.name == 'ok-to-test' &&
4647
github.event.pull_request.merged != true)
4748

0 commit comments

Comments
 (0)