Skip to content

code-generation

code-generation #279

# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".
name: code-generation
on:
workflow_dispatch: {}
schedule:
- cron: 0 0 * * *
jobs:
generate:
name: Code generation
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
patch_created: ${{ steps.create_patch.outputs.patch_created }}
steps:
- name: Checkout project
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: main
- name: Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: 20.x
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 7200
mask-aws-account-id: true
- name: Run code generation
run: npx projen generate-models-containers
- 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@18bf333cd2249fbbbdb605fd9d9ed57efd7adf34
with:
name: .repo.patch
path: .repo.patch
pr:
name: Create Pull Request
needs: generate
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ needs.generate.outputs.patch_created }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: main
- name: Download patch
uses: actions/download-artifact@b4aefff88e83a2676a730654e1ce3dce61880379
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@38e0b6e68b4c852a5500a94740f0e535e0d7ba54
with:
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
commit-message: |-
chore(deps): upgrade list of models and DLC images
Upgrade list of models and DLC images. See details in [workflow run].
[Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by projen via the "code-generation" workflow*
branch: github-actions/code-generation
title: "chore(deps): upgrade list of models and DLC images"
body: |-
Upgrade list of models and DLC images. See details in [workflow run].
[Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by projen via the "code-generation" workflow*
author: github-actions <[email protected]>
committer: github-actions <[email protected]>
signoff: true
labels: auto-approve