Skip to content

upgrade-main

upgrade-main #1101

Workflow file for this run

# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: upgrade-main
on:
workflow_dispatch: {}
schedule:
- cron: 0 6 * * 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
with:
ref: main
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Upgrade dependencies
run: npx projen upgrade
- name: Setup Go 1.24.2
uses: actions/setup-go@v5
with:
go-version: 1.24.2
cache-dependency-path: lambda/go.sum
- name: Display Go version
run: go version
- name: Upgrade Go dependencies
run: cd lambda && go get -u && go mod tidy && cd ..
- name: Test lambda code
run: scripts/lambda-test.sh
- name: Build lambda code and create zip
run: scripts/build.sh
- name: Create new Snapshots
run: npx projen "integ:snapshot-all"
- name: Find mutations
id: create_patch
run: |-
git add .
git diff --staged --patch --exit-code > repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT
shell: bash
working-directory: ./
- name: Upload patch
if: steps.create_patch.outputs.patch_created
uses: actions/[email protected]
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: Checkout
uses: actions/checkout@v4
with:
ref: main
- 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 "github-actions"
git config user.email "[email protected]"
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PROJEN_GITHUB_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-main" workflow*
branch: github-actions/upgrade-main
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-main" workflow*
author: github-actions <[email protected]>
committer: github-actions <[email protected]>
signoff: true
- name: Enable Pull Request Automerge
env:
GH_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }}
run: gh pr merge ${{ steps.create-pr.outputs.pull-request-number }} --merge --auto --delete-branch