Skip to content

Commit b9b0b26

Browse files
committed
ci: skip integration tests if CLOUDSCALE_API_TOKEN is missing
Dependabot PRs and PRs from forks do not have access to repository secrets. This change ensures that the integration test job is skipped when the API token is unavailable, preventing unnecessary build failures while still allowing linting and unit tests to run.
1 parent f778376 commit b9b0b26

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/ccm-integration-tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ jobs:
122122
integration:
123123
name: "Kubernetes ${{ matrix.kubernetes }}"
124124
runs-on: ubuntu-latest
125+
# Skip integration tests if the API token is missing (e.g., Dependabot or forks).
126+
# Additionally, only run for PRs whose head repo matches this repository to
127+
# avoid executing untrusted forked PR code with secrets.
128+
# Admins can manually trigger this job for a specific branch via the 'Actions' tab
129+
# using 'workflow_dispatch' after reviewing the code changes.
130+
if: |
131+
secrets.CLOUDSCALE_API_TOKEN != '' &&
132+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
125133
126134
needs:
127135
- lint

0 commit comments

Comments
 (0)