-
Notifications
You must be signed in to change notification settings - Fork 17
49 lines (49 loc) · 1.76 KB
/
manual-api-update.yaml
File metadata and controls
49 lines (49 loc) · 1.76 KB
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
---
name: "Update for API change"
on: # yamllint disable-line rule:truthy
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@v6"
- uses: "actions/setup-node@v6"
- 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.50.0"
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@v8.1.0"
if: "steps.buf-update.outputs.updated == 'true'"
with:
delete-branch: "true"
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
# This is how we ensure that workflows run
draft: "always-true"
title: "Update API to ${{ inputs.buftag }}"
commit-message: "chore: update api version"
base: "main"
branch: "api-change/${{ inputs.buftag }}"
token: "${{ secrets.GITHUB_TOKEN }}"