-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (55 loc) · 1.58 KB
/
bump-version.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
name: Bump Version
on:
pull_request:
branches:
- '*'
types:
- labeled
- unlabeled
jobs:
check-semver-label:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
labels: "patch, minor, major"
bump-version:
needs:
- check-semver-label
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Install Speakeasy
uses: mheap/setup-go-cli@v1
with:
owner: speakeasy-api
repo: speakeasy
cli_name: speakeasy
package_type: zip
version: 1.456.0 # renovate: datasource=github-releases depName=speakeasy-api/speakeasy
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.PAT }}
- name: Reset .speakeasy/gen.yaml to the version on main
run: |
git fetch origin main
git checkout origin/main .speakeasy/gen.yaml .speakeasy/gen.lock
- name: Set bump (patch)
run: |
BUMP_TYPE=$(echo '${{ toJson(github.event.pull_request.labels.*.name) }}' | jq -r '.[]' | grep -E 'patch|minor|major')
speakeasy bump $BUMP_TYPE
- name: Commit SDK changes to the PR
uses: EndBug/add-and-commit@v9
with:
add: .
default_author: github_actor
message: Bump .speakeasy/gen.yaml based on label