Skip to content

Commit

Permalink
Add Github Workflow for checking Go API compatibility on PRs
Browse files Browse the repository at this point in the history
It'll check API compatibility for each new PR.
If the check is compatible, the label `semver:minor` will be added.
If not, `semver:major` will be used.

Now there is no way to detect whether there is an actual API change or
not (ie make a diff between `minor` and `patch`).
  • Loading branch information
EmilienM committed Aug 16, 2023
1 parent 117d6fc commit 5f4809e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/semver-auto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Add PR semver labels on push
on:
pull_request_target:
types: [synchronize]
jobs:
go-apidiff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-go@v2
with:
go-version: '1'

- name: Remove the semver label
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
with:
labels: |
semver:patch
semver:minor
semver:major
github_token: ${{ github.token }}

- name: Checking Go API Compatibility
uses: joelanford/go-apidiff@7037613b8a1dfa41270919a854e3703953c36d8f

- name: Add semver:minor label
if: ${{ success() }}
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:minor

- name: Add semver:major label
if: ${{ failure() }}
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: semver:major
21 changes: 0 additions & 21 deletions .github/workflows/semver-unlabel.yaml

This file was deleted.

0 comments on commit 5f4809e

Please sign in to comment.