-
Notifications
You must be signed in to change notification settings - Fork 31
Add dependency checker comment #2093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0cc7393
48373c0
190a713
a4ea6ac
4ed6465
60b7728
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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', | ||
| }); | ||
jonathanKingston marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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', | ||
| }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Duplicate recreate comments on every push to mainThe workflow runs on every push to main and creates a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only if |
||
| console.log(`Requested recreate for PR #${pr.number}`); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.