-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (35 loc) · 1.21 KB
/
merge-dependabot-prs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Combine Dependabot PRs
on:
schedule:
- cron: '0 9 1 * *' # Runs at 09:00 on the 1st of every month
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
combine-dependabot-prs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Fetch all branches
run: git fetch --all
- name: Create combined branch
run: |
git checkout -b ci/combined-dependabot-updates
for branch in $(git branch -r | grep 'dependabot/npm_and_yarn' | sed 's/origin\///'); do
echo $branch
git pull origin $branch --no-rebase || true
done
- name: Push combined branch
run: |
git push origin ci/combined-dependabot-updates
- name: Create pull request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.NPM_TOKEN }}
branch: combined-dependabot-updates
title: 'Combined Dependabot Updates'
body: 'This pull request combines all Dependabot updates for this month.'
base: main