Skip to content

upgrade

upgrade #448

Workflow file for this run

# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".
name: upgrade
on:
workflow_dispatch: {}
schedule:
- cron: 0 0 * * *
jobs:
upgrade:
name: Upgrade
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
patch_created: ${{ steps.create_patch.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.7.1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.16.0
cache: pnpm
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Upgrade dependencies
run: pnpm exec 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
working-directory: ./
- name: Upload patch
if: steps.create_patch.outputs.patch_created
uses: actions/upload-artifact@v4
with:
name: .repo.patch
path: .repo.patch
overwrite: true
pr:
name: Create Pull Request
needs: upgrade
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ needs.upgrade.outputs.patch_created }}
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
with:
app_id: ${{ secrets.CCU_BOT_APP_ID }}
private_key: ${{ secrets.CCU_BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
- name: Download patch
uses: actions/download-artifact@v4
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 "${{ vars.CCU_BOT_GIT_NAME }}"
git config user.email "${{ vars.CCU_BOT_GIT_EMAIL }}"
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate_token.outputs.token }}
commit-message: |-
chore(deps): upgrade dependencies
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by projen via the "upgrade" workflow*
branch: github-actions/upgrade
title: "chore(deps): upgrade dependencies"
labels: auto-approve
body: |-
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by projen via the "upgrade" workflow*
author: ${{ vars.CCU_BOT_GIT_NAME }} <${{ vars.CCU_BOT_GIT_EMAIL }}>
committer: ${{ vars.CCU_BOT_GIT_NAME }} <${{ vars.CCU_BOT_GIT_EMAIL }}>
signoff: true