Skip to content

Commit dc87257

Browse files
authored
fix(ci): keep dependabot and fork PRs green (#46)
* fix(ci): keep dependabot and fork PRs green Dependabot/fork PRs run without repo secrets, so three jobs failed on them: - lint-and-test: HAS_PRIVATE_ACCESS was true for dependabot (same-repo head), so it tried to clone the private mock-api with an empty DCD_SSH_DEPLOY_KEY. Now excludes dependabot[bot], same as forks (skips mock-api + integration). - claude-code-review: skips dependabot/fork PRs (no CLAUDE_CODE_OAUTH_TOKEN). - cla: skips its action step until PERSONAL_ACCESS_TOKEN is configured so the check is green instead of 'Branch cla-signatures not found'; also fixes two invalid input names (custom-*-prompt -> custom-*-prcomment). * ci: group all github-actions bumps into one weekly PR Wildcard pattern so major action bumps join the group too, instead of one PR per action.
1 parent ebac7e2 commit dc87257

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ updates:
2828
commit-message:
2929
prefix: ci
3030
groups:
31+
# One PR per week for ALL action bumps (including majors). Actions are
32+
# low-risk and quick to eyeball together; no need for a PR each.
3133
actions:
32-
update-types:
33-
- minor
34-
- patch
34+
patterns:
35+
- "*"

.github/workflows/cla.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ permissions:
3030
jobs:
3131
cla:
3232
runs-on: ubuntu-latest
33+
# Empty until the PERSONAL_ACCESS_TOKEN secret is configured (see SETUP above).
34+
# While empty, the action step below is skipped so this check passes (green)
35+
# instead of failing on every PR with "Branch cla-signatures not found". It
36+
# auto-activates once the secret + cla-signatures branch exist.
37+
env:
38+
HAS_CLA_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN != '' }}
3339
# Only act on the signature comment or on PR events (not every comment).
3440
if: (github.event.issue.pull_request && contains(github.event.comment.body, 'I have read the CLA Document and I hereby sign the CLA')) || github.event_name == 'pull_request_target'
3541
steps:
3642
- uses: contributor-assistant/github-action@v2.6.1
43+
if: env.HAS_CLA_TOKEN == 'true'
3744
env:
3845
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3946
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
@@ -44,6 +51,6 @@ jobs:
4451
# PR target branches the CLA applies to.
4552
allowlist: dependabot[bot],renovate[bot],*[bot]
4653
# Customise the bot's prompts if desired:
47-
custom-notsigned-prompt: "Thanks for your contribution! Please sign our Contributor License Agreement before we can merge. Comment the line below to sign:"
54+
custom-notsigned-prcomment: "Thanks for your contribution! Please sign our Contributor License Agreement before we can merge. Comment the line below to sign:"
4855
custom-pr-sign-comment: "I have read the CLA Document and I hereby sign the CLA"
49-
custom-allsigned-prompt: "All contributors have signed the CLA. ✍️ ✅"
56+
custom-allsigned-prcomment: "All contributors have signed the CLA. ✍️ ✅"

.github/workflows/claude-code-review.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ on:
1212

1313
jobs:
1414
claude-review:
15-
# Optional: Filter by PR author
16-
# if: |
17-
# github.event.pull_request.user.login == 'external-contributor' ||
18-
# github.event.pull_request.user.login == 'new-developer' ||
19-
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20-
15+
# The review needs CLAUDE_CODE_OAUTH_TOKEN, which is NOT exposed to PRs that
16+
# run without secrets — Dependabot PRs and PRs from forks. Skip them so the
17+
# check doesn't fail with an empty token; same-repo PRs only.
18+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
2119
runs-on: ubuntu-latest
2220
permissions:
2321
contents: read

.github/workflows/cli-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ jobs:
4040
# SSH deploy key. GitHub does NOT expose secrets to pull_request workflows
4141
# triggered from forks, so that checkout (and the integration tests that need
4242
# it) can only run for same-repo events. Fork PRs still run lint/typecheck/build.
43+
#
44+
# Dependabot PRs branch from this repo (so the fork check passes) but ALSO run
45+
# without secrets — treat them like forks and skip the private checkout, or
46+
# the mock-api clone fails with an empty DCD_SSH_DEPLOY_KEY.
4347
env:
44-
HAS_PRIVATE_ACCESS: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
48+
HAS_PRIVATE_ACCESS: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]' }}
4549

4650
steps:
4751
- name: Checkout CLI

0 commit comments

Comments
 (0)