Skip to content

Commit 5462e68

Browse files
mrw-rlclaude
andauthored
chore: add dependency age check to CI (#195)
## Summary - Adds `dependency-check` job to CI workflow using `runloopai/dependency-age-check-action@main` - Checks that newly added npm packages in `pnpm-lock.yaml` were published at least 14 days ago - Added to `ready-to-merge` gate (allows `skipped` for `workflow_dispatch` runs) ## Test plan - [ ] Open a PR with a lockfile change and verify the check runs - [ ] Verify `workflow_dispatch` still passes (dependency-check is skipped) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 150f8ae commit 5462e68

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,30 @@ jobs:
129129
path: coverage/
130130
retention-days: 7
131131

132+
dependency-check:
133+
runs-on: ubuntu-slim
134+
if: github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')
135+
steps:
136+
- name: Checkout code
137+
uses: actions/checkout@v6
138+
with:
139+
ref: ${{ github.event.pull_request.head.sha }}
140+
repository: ${{ github.event.pull_request.head.repo.full_name }}
141+
142+
- name: Fetch base ref
143+
run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1
144+
145+
- name: Check dependency age (supply-chain gate)
146+
uses: runloopai/dependency-age-check-action@main
147+
with:
148+
ecosystems: npm
149+
min-age-days: "14"
150+
base-ref: origin/${{ github.event.pull_request.base.ref }}
151+
132152
ready-to-merge:
133153
runs-on: ubuntu-slim
134-
needs: [format, lint, build, test]
154+
permissions: {}
155+
needs: [format, lint, build, test, dependency-check]
135156
# Run from pull_request for non-release-please branches, or pull_request_target for release-please branches only
136157
if: always() && ((github.event_name == 'pull_request' && !startsWith(github.event.pull_request.head.ref, 'release-please--')) || (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'release-please--')) || github.event_name == 'workflow_dispatch')
137158
steps:
@@ -140,7 +161,8 @@ jobs:
140161
if [[ "${{ needs.format.result }}" != "success" ]] || \
141162
[[ "${{ needs.lint.result }}" != "success" ]] || \
142163
[[ "${{ needs.build.result }}" != "success" ]] || \
143-
[[ "${{ needs.test.result }}" != "success" ]]; then
164+
[[ "${{ needs.test.result }}" != "success" ]] || \
165+
[[ "${{ needs.dependency-check.result }}" != "success" && "${{ needs.dependency-check.result }}" != "skipped" ]]; then
144166
echo "One or more required jobs failed"
145167
exit 1
146168
fi

0 commit comments

Comments
 (0)