Skip to content

Upgrade Dependencies #147

Upgrade Dependencies

Upgrade Dependencies #147

Workflow file for this run

---
name: Upgrade Dependencies
on:
workflow_dispatch: {}
schedule:
- cron: 0 9 * * 2 # every Tuesday at 9am
permissions:
contents: write
pull-requests: write
jobs:
upgrade:
name: Upgrade
runs-on: ubuntu-latest
outputs:
patch_created: ${{ steps.create_patch.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903
with:
node-version: 18.x
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Upgrade dependencies
run: npx projen upgrade
- name: Find mutations
id: create_patch
run: |-
git add .
git diff --staged --patch --exit-code > .repo.patch || echo "patch_created=true" >> "${GITHUB_OUTPUT}"
- name: Upload patch
if: steps.create_patch.outputs.patch_created
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: .repo.patch
path: .repo.patch
pr:
name: Create Pull Request
needs: upgrade
runs-on: ubuntu-latest
if: ${{ needs.upgrade.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Download patch
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: .repo.patch
path: ${{ runner.temp }}
- name: Apply patch
run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."'
- name: Set git identity
run: |-
git config user.name "svc-apix-bot"
git config user.email "[email protected]"
- name: Create Pull Request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with:
token: ${{ secrets.APIX_BOT_PAT }}
title: "chore: Upgrade dependencies"
commit-message: "Upgrade dependencies"
delete-branch: true
branch: upgrade-dependencies
body: "Upgrades project dependencies. See details in [workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
author: svc-apix-bot <[email protected]>
committer: svc-apix-bot <[email protected]>
signoff: true