-
Notifications
You must be signed in to change notification settings - Fork 510
63 lines (55 loc) · 1.97 KB
/
semver-auto.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
name: Add PR semver labels
on:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
go-apidiff:
runs-on: ubuntu-latest
steps:
- name: Remove the semver labels
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: |
semver:patch
semver:minor
semver:major
semver:unknown
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: peter-evans/rebase@56c359b35ff7ba8426d0fdb842958b35b1db8277
with:
base: ${{ github.base_ref }}
- name: Add semver:unknown label
if: failure()
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:unknown
- uses: actions/setup-go@v4
with:
go-version: '1'
- name: Checking Go API Compatibility
id: go-apidiff
uses: joelanford/go-apidiff@v0.7.0
- name: Add semver:patch label
if: always() && steps.go-apidiff.outputs.semver-type == 'patch'
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:patch
- name: Add semver:minor label
if: always() && steps.go-apidiff.outputs.semver-type == 'minor'
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:minor
- name: Add semver:major label
if: always() && steps.go-apidiff.outputs.semver-type == 'major'
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:major