Auto Yarn Upgrade #1
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: Auto Yarn Upgrade | |
on: | |
schedule: | |
# Runs at 00:00 on the first day of every month | |
- cron: "0 0 1 * *" | |
workflow_dispatch: # This allows manual triggering | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
upgrade: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install and upgrade dependencies | |
run: | | |
yarn | |
yarn upgrade | |
- name: Commit changes | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "upgrade dependencies" || echo "No changes to commit" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: upgrade dependencies | |
branch: auto-upgrade-branch | |
title: "Yarn Upgrade" | |
body: "This PR updates dependencies via `yarn upgrade`" |