Skip to content

Commit ed9e49b

Browse files
Add dependency checker comment (#2093)
* Add dependency checker comment * Add comment when dependabot gets stale to recreate * Add opened check to prevent multiple comments * Lint fix * Add a comment about coverage
1 parent 2b9d7a4 commit ed9e49b

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/dependabot-auto-merge.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,16 @@ jobs:
3030
env:
3131
PR_URL: ${{ github.event.pull_request.html_url }}
3232
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Request Cursor review
35+
if: github.event.action == 'opened'
36+
run: |
37+
gh pr comment "$PR_URL" --body "@cursoragent can you review against the current code and outline potential impacts based on the changelogs of the update?
38+
39+
Can you check the test coverage and ensure that the new code is covered?
40+
Can you think through if this dependency is still needed or if there's better practices used elsewhere.
41+
42+
Can you draft a separate PR with any fixes that might be needed?"
43+
env:
44+
PR_URL: ${{ github.event.pull_request.html_url }}
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Dependabot conflict detector
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
check-conflicts:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check Dependabot PRs for conflicts
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
const { data: pulls } = await github.rest.pulls.list({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
state: 'open',
22+
});
23+
24+
const dependabotPRs = pulls.filter(pr => pr.user.login === 'dependabot[bot]');
25+
26+
for (const pr of dependabotPRs) {
27+
// Fetch full PR to get accurate mergeable status
28+
const { data: fullPR } = await github.rest.pulls.get({
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
pull_number: pr.number,
32+
});
33+
34+
if (fullPR.mergeable === false) {
35+
await github.rest.issues.createComment({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
issue_number: pr.number,
39+
body: '@dependabot recreate',
40+
});
41+
console.log(`Requested recreate for PR #${pr.number}`);
42+
}
43+
}

0 commit comments

Comments
 (0)