Skip to content

Commit 12ea9bd

Browse files
Merge branch 'main' into dependabot-github_actions-actions-dependency-review-action-4
2 parents 9f55bcd + f7bd793 commit 12ea9bd

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

.github/scripts/update-prs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const updatePrs = async ({ github, context }) => {
1010
per_page: 100
1111
});
1212

13-
const nonDraftPulls = pulls?.data?.filter((pr) => !pr.draft);
13+
const nonDraftAndDependabotPulls = pulls?.data?.filter((pr) => !pr.draft && pr.user.login !== "dependabot[bot]");
1414
let updatedBranches = 0;
1515

16-
if (nonDraftPulls?.length > 0) {
17-
for (const pr of nonDraftPulls) {
16+
if (nonDraftAndDependabotPulls?.length > 0) {
17+
for (const pr of nonDraftAndDependabotPulls) {
1818
try {
1919
await github.rest.pulls.updateBranch({
2020
owner,
@@ -28,7 +28,7 @@ const updatePrs = async ({ github, context }) => {
2828
}
2929
}
3030

31-
return `Updated branches: ${updatedBranches}/${nonDraftPulls.length}`;
31+
return `Updated branches: ${updatedBranches}/${nonDraftAndDependabotPulls.length}`;
3232
};
3333

3434
export default updatePrs;

.github/workflows/update-prs.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# ---
2-
# name: Update all PR branches if main gets update
1+
---
2+
name: Update all PR branches if main gets update
33

4-
# on:
5-
# push:
6-
# branches:
7-
# - "main"
4+
on:
5+
push:
6+
branches:
7+
- "main"
88

9-
# jobs:
10-
# update-prs:
11-
# name: Update PRs
12-
# runs-on: ubuntu-latest
13-
# steps:
14-
# - name: ⬇ Checkout repo
15-
# uses: actions/checkout@v3
9+
jobs:
10+
update-prs:
11+
name: Update PRs
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: ⬇ Checkout repo
15+
uses: actions/checkout@v3
1616

17-
# - name: ⌚ Update PRs
18-
# id: update-prs
19-
# uses: actions/github-script@v6
20-
# with:
21-
# script: |
22-
# const { default: updatePrs } = await import('${{ github.workspace }}/.github/scripts/update-prs.js');
23-
# // print how many PRs are updated
24-
# console.log(await updatePrs({github, context}));
17+
- name: ⌚ Update PRs
18+
id: update-prs
19+
uses: actions/github-script@v6
20+
with:
21+
script: |
22+
const { default: updatePrs } = await import('${{ github.workspace }}/.github/scripts/update-prs.js');
23+
// print how many PRs are updated
24+
console.log(await updatePrs({github, context}));

0 commit comments

Comments
 (0)