-
Notifications
You must be signed in to change notification settings - Fork 78
99 lines (98 loc) · 3.78 KB
/
Copy pathcode-generation.yml
File metadata and controls
99 lines (98 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# ~~ 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
ref: main
- name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
with:
node-version: 22.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 .
if git diff --staged --quiet; then
echo "No changes detected"
else
git diff --staged --patch > repo.patch
echo "patch_created=true" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Upload patch
if: steps.create_patch.outputs.patch_created
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: repo.patch
path: repo.patch
overwrite: true
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
ref: main
- name: Download patch
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
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[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f
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[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
signoff: true
labels: auto-approve