forked from authzed/authzed-node
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (64 loc) · 2.13 KB
/
manual-api-update.yaml
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
name: Update for API change
on:
workflow_dispatch:
inputs:
buftag:
description: Tag or commit from https://buf.build/authzed/api/tags/main
required: true
type: string
jobs:
test:
name: "Create PR for API update"
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: "Update Buf Script"
id: buf-update
uses: authzed/actions/buf-api-update@main
with:
api-commit: ${{ inputs.buftag }}
spec-path: buf.gen.yaml
file-format: generate-shell-script
- name: "Output update status"
env:
UPDATED_STATUS: ${{ steps.buf-update.outputs.updated }}
run: |
echo "Update status: $UPDATED_STATUS"
- name: "Update package version"
uses: authzed/actions/semver-update@main
if: steps.buf-update.outputs.updated == 'true'
with:
sourcefile-path: package.json
version-regex: '"version": "(.+)"'
version-change: minor
- name: "Update js-dist package version"
uses: authzed/actions/semver-update@main
if: steps.buf-update.outputs.updated == 'true'
with:
sourcefile-path: js-dist/package.json
version-regex: '"version": "(.+)"'
version-change: minor
- name: "Install NPM deps"
uses: bahmutov/npm-install@v1
if: steps.buf-update.outputs.updated == 'true'
with:
working-directory: ./
- name: "Install buf"
uses: "bufbuild/buf-setup-action@v1.39.0"
if: steps.buf-update.outputs.updated == 'true'
with:
version: "1.37.0"
- name: "Run buf generate"
if: steps.buf-update.outputs.updated == 'true'
run: |
./buf.gen.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6.1.0
if: steps.buf-update.outputs.updated == 'true'
with:
delete-branch: "true"
title: Update API to ${{ inputs.buftag }}
branch: api-change/${{ inputs.buftag }}
token: ${{ secrets.GITHUB_TOKEN }}