diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 97a6701d3b..3b255599ef 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -30,3 +30,16 @@ jobs: env: PR_URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Request Cursor review + if: github.event.action == 'opened' + run: | + 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? + + Can you check the test coverage and ensure that the new code is covered? + Can you think through if this dependency is still needed or if there's better practices used elsewhere. + + Can you draft a separate PR with any fixes that might be needed?" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/dependabot-conflict-detector.yml b/.github/workflows/dependabot-conflict-detector.yml new file mode 100644 index 0000000000..d576ee6970 --- /dev/null +++ b/.github/workflows/dependabot-conflict-detector.yml @@ -0,0 +1,43 @@ +name: Dependabot conflict detector + +on: + push: + branches: [main] + +permissions: + pull-requests: write + +jobs: + check-conflicts: + runs-on: ubuntu-latest + steps: + - name: Check Dependabot PRs for conflicts + uses: actions/github-script@v7 + with: + script: | + const { data: pulls } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + }); + + const dependabotPRs = pulls.filter(pr => pr.user.login === 'dependabot[bot]'); + + for (const pr of dependabotPRs) { + // Fetch full PR to get accurate mergeable status + const { data: fullPR } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: pr.number, + }); + + if (fullPR.mergeable === false) { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + body: '@dependabot recreate', + }); + console.log(`Requested recreate for PR #${pr.number}`); + } + }