Skip to content

Commit 030eb3f

Browse files
committed
Use standard rebuild approach
1 parent 6a1f9b0 commit 030eb3f

2 files changed

Lines changed: 18 additions & 57 deletions

File tree

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: Called update for API change
1+
name: "Called update for API change"
22
on:
33
repository_dispatch:
4-
types: [api_update]
4+
types: ["api_update"]
55
jobs:
66
test:
77
name: "Create PR for API update"
@@ -14,48 +14,28 @@ jobs:
1414
id: buf-update
1515
uses: authzed/actions/buf-api-update@main
1616
with:
17-
api-commit: ${{ github.event.client_payload.BUFTAG }}
17+
api-commit: "${{ github.event.client_payload.BUFTAG }}"
1818
spec-path: buf.gen.yaml
19-
file-format: generate-shell-script
19+
file-format: "buf-gen-yaml"
2020
- name: "Output update status"
2121
env:
2222
UPDATED_STATUS: ${{ steps.buf-update.outputs.updated }}
2323
run: |
2424
echo "Update status: $UPDATED_STATUS"
25-
- name: "Update package version"
26-
uses: authzed/actions/semver-update@main
27-
if: steps.buf-update.outputs.updated == 'true'
28-
with:
29-
sourcefile-path: package.json
30-
version-regex: '"version": "(.+)"'
31-
version-change: minor
32-
- name: "Update js-dist package version"
33-
uses: authzed/actions/semver-update@main
34-
if: steps.buf-update.outputs.updated == 'true'
35-
with:
36-
sourcefile-path: js-dist/package.json
37-
version-regex: '"version": "(.+)"'
38-
version-change: minor
39-
- name: "Install NPM deps"
40-
uses: bahmutov/npm-install@v1
41-
if: steps.buf-update.outputs.updated == 'true'
42-
with:
43-
useLockFile: false
44-
working-directory: ./
4525
- name: "Install buf"
46-
uses: "bufbuild/buf-setup-action@v1.46.0"
47-
if: steps.buf-update.outputs.updated == 'true'
26+
uses: "bufbuild/buf-setup-action@v1.43.0"
4827
with:
49-
version: "1.37.0"
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
if: steps.buf-update.outputs.updated == 'true'
5030
- name: "Run buf generate"
5131
if: steps.buf-update.outputs.updated == 'true'
52-
run: |
53-
./buf.gen.yaml
32+
run: "buf generate"
5433
- name: Create Pull Request
5534
uses: peter-evans/create-pull-request@v7.0.5
5635
if: steps.buf-update.outputs.updated == 'true'
5736
with:
5837
delete-branch: "true"
59-
title: Update API to ${{ github.event.client_payload.BUFTAG }}
60-
branch: api-change/${{ github.event.client_payload.BUFTAG }}
38+
title: "Update API to ${{ github.event.client_payload.BUFTAG }}"
39+
branch: "api-change/${{ github.event.client_payload.BUFTAG }}"
40+
base: "main"
6141
token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Update for API change
23
on:
34
workflow_dispatch:
@@ -20,46 +21,26 @@ jobs:
2021
with:
2122
api-commit: ${{ inputs.buftag }}
2223
spec-path: buf.gen.yaml
23-
file-format: generate-shell-script
24+
file-format: "buf-gen-yaml"
2425
- name: "Output update status"
2526
env:
2627
UPDATED_STATUS: ${{ steps.buf-update.outputs.updated }}
2728
run: |
2829
echo "Update status: $UPDATED_STATUS"
29-
- name: "Update package version"
30-
uses: authzed/actions/semver-update@main
31-
if: steps.buf-update.outputs.updated == 'true'
32-
with:
33-
sourcefile-path: package.json
34-
version-regex: '"version": "(.+)"'
35-
version-change: minor
36-
- name: "Update js-dist package version"
37-
uses: authzed/actions/semver-update@main
38-
if: steps.buf-update.outputs.updated == 'true'
39-
with:
40-
sourcefile-path: js-dist/package.json
41-
version-regex: '"version": "(.+)"'
42-
version-change: minor
43-
- name: "Install NPM deps"
44-
uses: bahmutov/npm-install@v1
45-
if: steps.buf-update.outputs.updated == 'true'
46-
with:
47-
useLockFile: false
48-
working-directory: ./
4930
- name: "Install buf"
50-
uses: "bufbuild/buf-setup-action@v1.46.0"
51-
if: steps.buf-update.outputs.updated == 'true'
31+
uses: "bufbuild/buf-setup-action@v1.43.0"
5232
with:
53-
version: "1.37.0"
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
if: steps.buf-update.outputs.updated == 'true'
5435
- name: "Run buf generate"
5536
if: steps.buf-update.outputs.updated == 'true'
56-
run: |
57-
./buf.gen.yaml
37+
run: "buf generate"
5838
- name: Create Pull Request
5939
uses: peter-evans/create-pull-request@v7.0.5
6040
if: steps.buf-update.outputs.updated == 'true'
6141
with:
6242
delete-branch: "true"
6343
title: Update API to ${{ inputs.buftag }}
6444
branch: api-change/${{ inputs.buftag }}
45+
base: "main"
6546
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)