Skip to content

Implement Limit controller #339

Implement Limit controller

Implement Limit controller #339

Workflow file for this run

name: Semver analysis
on:
pull_request:
types:
- opened
- synchronize
- reopened
permissions:
contents: read
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # tag=v7.0.0
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Rebase the PR against base ref to ensure actual API compatibility
run: |
git config --global user.email "localrebase@k-orc.cloud"
git config --global user.name "Local rebase"
git rebase -i origin/$BASE_REF
env:
GIT_SEQUENCE_EDITOR: '/usr/bin/true'
BASE_REF: ${{ github.base_ref }}
- name: Calculate go version
id: vars
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # tag=v6.5.0
with:
go-version: ${{ steps.vars.outputs.go_version }}
- name: Checking Go API Compatibility
id: go-apidiff
# if semver=major, this will return RC=1, so let's ignore the failure so label
# can be set later. We check for actual errors in the next step.
continue-on-error: true
uses: joelanford/go-apidiff@60c4206be8f84348ebda2a3e0c3ac9cb54b8f685 # tag=v0.8.3
# go-apidiff returns RC=1 when semver=major, which makes the workflow to return
# a failure. Instead let's just return a failure if go-apidiff failed to run.
- name: Return an error if Go API Compatibility couldn't be verified
if: steps.go-apidiff.outcome != 'success' && steps.go-apidiff.outputs.semver-type != 'major'
run: exit 1
- name: Save semver result
if: always()
run: |
mkdir -p semver-results
echo "$SEMVER_TYPE" > semver-results/semver-type
echo "$PR_NUMBER" > semver-results/pr-number
env:
SEMVER_TYPE: ${{ steps.go-apidiff.outputs.semver-type }}
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Upload semver results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # tag=v7.0.1
with:
name: semver-results
path: semver-results/