Upgrade Dependencies #983
This file contains hidden or 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: Upgrade Dependencies | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: 0 0 * * * | |
jobs: | |
upgrade: | |
name: Upgrade | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Install dependencies | |
run: npm ci | |
- name: Upgrade dependencies | |
env: | |
CI: false | |
run: npm run upgrade:all | |
- name: Create Patch | |
run: |- | |
git add . | |
git diff --patch --staged > .upgrade.tmp.patch | |
- name: Upload patch | |
uses: actions/upload-artifact@v2 | |
with: | |
name: .upgrade.tmp.patch | |
path: .upgrade.tmp.patch | |
pr: | |
name: Create Pull Request | |
needs: upgrade | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
checks: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download patch | |
uses: actions/download-artifact@v2 | |
with: | |
name: .upgrade.tmp.patch | |
path: ${{ runner.temp }} | |
- name: Apply patch | |
run: '[ -s ${{ runner.temp }}/.upgrade.tmp.patch ] && git apply ${{ runner.temp | |
}}/.upgrade.tmp.patch || echo "Empty patch. Skipping."' | |
- name: Create Pull Request | |
id: create-pr | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
commit-message: >- | |
chore(deps): upgrade dependencies | |
Upgrades project dependencies. See details in [workflow run]. | |
[workflow run]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
------ | |
*Automatically created via the "upgrade-dependencies" workflow* | |
branch: github-actions/upgrade | |
title: "chore(deps): upgrade dependencies" | |
body: >- | |
Upgrades project dependencies. See details in [workflow run]. | |
[workflow run]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
------ | |
*Automatically created via the "upgrade-dependencies" workflow* | |
author: superluminar-bot <[email protected]> | |
committer: superluminar-bot <[email protected]> | |
- name: Enable Pull Request Automerge | |
if: steps.create-pr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v1 | |
with: | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} | |
merge-method: squash |