-
Notifications
You must be signed in to change notification settings - Fork 1.3k
70 lines (67 loc) · 2.11 KB
/
new_client.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
---
name: new_client
on:
push:
# Per GitHub Action docs, specifying both branch and paths joins them with AND.
branches:
- main
paths:
- '**/version.go'
permissions:
contents: read
env:
GOTOOLCHAIN: local
jobs:
new_versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-go@v5
with:
go-version: 1.23.x
- name: Find new version files
id: versions
# Ignore changes to the internal and root directories.
# Focus on newly added version.go files generated by GAPIC.
# Multiple new version files in a single module file will be deduped.
run: |
dirs=$(go run ./internal/actions/cmd/changefinder -q --base=HEAD~1 --diff-filter=A --path-filter='*version.go' --content-regex='internal\.Version')
if [ -z "$dirs" ]
then
echo "skip=1" >> $GITHUB_OUTPUT
echo "No new version files!"
else
for d in $dirs; do list=${list},\"${d}\"; done
echo "new={\"new\":[${list#,}]}" >> $GITHUB_OUTPUT
echo "skip=" >> $GITHUB_OUTPUT
fi
outputs:
versions: ${{ steps.versions.outputs.new }}
skip: ${{ steps.versions.outputs.skip }}
bump_module:
needs: new_versions
runs-on: ubuntu-latest
if: "!needs.new_versions.outputs.skip"
continue-on-error: true
strategy:
matrix: ${{ fromJson(needs.new_versions.outputs.versions) }}
steps:
- uses: actions/checkout@v4
- run: echo >> ${{ matrix.new }}/CHANGES.md
- uses: googleapis/code-suggester@v4
id: code_suggester
env:
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
with:
command: pr
upstream_owner: googleapis
upstream_repo: google-cloud-go
description: 'New client(s) generated in ${{ github.event.commits[0].url }}, triggering release.'
title: 'feat(${{ matrix.new }}): new client(s)'
message: 'feat(${{ matrix.new }}): new clients'
primary: 'main'
branch: release-${{ matrix.new }}-client
git_dir: '.'
force: true