-
Notifications
You must be signed in to change notification settings - Fork 15
45 lines (45 loc) · 1.46 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
---
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"
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: "buf-gen-yaml"
- name: "Output update status"
env:
UPDATED_STATUS: "${{ steps.buf-update.outputs.updated }}"
run: |
echo "Update status: $UPDATED_STATUS"
- name: "Install buf"
uses: "bufbuild/buf-setup-action@v1.47.2"
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
if: "steps.buf-update.outputs.updated == 'true'"
- name: "Run buf generate"
if: "steps.buf-update.outputs.updated == 'true'"
run: "buf generate"
- name: "Create Pull Request"
uses: "peter-evans/create-pull-request@v7.0.5"
if: "steps.buf-update.outputs.updated == 'true'"
with:
delete-branch: "true"
title: "Update API to ${{ inputs.buftag }}"
base: "main"
branch: "api-change/${{ inputs.buftag }}"
token: "${{ secrets.GITHUB_TOKEN }}"