Skip to content

Commit 4ed6465

Browse files
Lint fix
1 parent a4ea6ac commit 4ed6465

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed
Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
11
name: Dependabot conflict detector
22

33
on:
4-
push:
5-
branches: [main]
4+
push:
5+
branches: [main]
66

77
permissions:
8-
pull-requests: write
8+
pull-requests: write
99

1010
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-
});
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+
});
2323
24-
const dependabotPRs = pulls.filter(pr => pr.user.login === 'dependabot[bot]');
24+
const dependabotPRs = pulls.filter(pr => pr.user.login === 'dependabot[bot]');
2525
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-
}
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+
});
4433
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)