Combine Dependabot PRs #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --allow-unrelated-histories || 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 |