-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (74 loc) · 2.93 KB
/
codegen.yml
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
name: Codegen
on:
workflow_dispatch:
schedule:
- cron: "0 0,12 * * *"
jobs:
update-models:
name: "Codegen: update models"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_GITHUB_TOKEN_PUBLIC }}
- uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate clients from models
run: pnpm codegen clients
- name: Regenerate lockfile
run: pnpm install --lockfile-only
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create or update clients pull request
uses: peter-evans/create-pull-request@v7
with:
add-paths: clients,pnpm-lock.yaml
branch: codegen/update-models
token: ${{ secrets.BOT_GITHUB_TOKEN_PUBLIC }}
title: "feat(clients): update models as of ${{ steps.date.outputs.date }}"
commit-message: "feat(clients): update models as of ${{ steps.date.outputs.date }}"
body: |
This is an automated pull request that was generated due to changes detected in the [Amazon Selling Partner API models](https://github.com/amzn/selling-partner-api-models).
The branch associated with this PR will be automatically updated if other changes occur.
delete-branch: true
reviewers: tusbar
update-schemas:
name: "Codegen: update schemas"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_GITHUB_TOKEN_PUBLIC }}
- uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate schemas
run: pnpm codegen schemas
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create or update schemas pull request
uses: peter-evans/create-pull-request@v7
with:
add-paths: packages/schemas
branch: codegen/update-schemas
token: ${{ secrets.BOT_GITHUB_TOKEN_PUBLIC }}
title: "feat(schemas): update schemas as of ${{ steps.date.outputs.date }}"
commit-message: "feat(schemas): update schemas as of ${{ steps.date.outputs.date }}"
body: |
This is an automated pull request that was generated due to changes detected in the [Amazon Selling Partner API models](https://github.com/amzn/selling-partner-api-models).
The branch associated with this PR will be automatically updated if other changes occur.
delete-branch: true
reviewers: tusbar