-
-
Notifications
You must be signed in to change notification settings - Fork 142
76 lines (68 loc) · 2.09 KB
/
update-schema.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
name: update schema
on:
workflow_call:
secrets:
APP_ID:
required: true
APP_PRIVATE_KEY:
required: true
inputs:
schema-name:
type: string
required: true
make-command:
type: string
required: true
branch:
type: string
default: "feat/update-schema"
required: false
jobs:
update-schema:
runs-on: ubuntu-latest
steps:
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout latest code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
cache: false
- name: Get Go environment
id: go-env
run: |
echo "::set-output name=cache::$(go env GOCACHE)"
echo "::set-output name=modcache::$(go env GOMODCACHE)"
- name: Set up cache
uses: actions/cache@v4
with:
path: |
${{ steps.go-env.outputs.cache }}
${{ steps.go-env.outputs.modcache }}
key: update-schema-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/go.mod') }}
restore-keys: |
update-schema-${{ runner.os }}-go-
- name: Update schema
run: make ${{ inputs.make-command }}
- name: Generate files
run: make generate
- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@v7
with:
author: GitHub <[email protected]>
committer: GitHub <[email protected]>
commit-message: 'feat(schema): update ${{ inputs.schema-name }} to the latest layer'
branch: ${{ inputs.branch }}
delete-branch: true
token: ${{ steps.generate-token.outputs.token }}
title: Update ${{ inputs.schema-name }} schema to the latest layer
body: |
Update ${{ inputs.schema-name }} schema to the latest layer.
labels: |
dependencies