2022-11-30 22:32:06 +00:00
|
|
|
name: Lint Checks
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
# run per commit ci checks against this commit
|
|
|
|
jobs:
|
|
|
|
proto-lint:
|
|
|
|
uses: ./.github/workflows/proto.yml
|
|
|
|
golangci-lint:
|
|
|
|
runs-on: ubuntu-latest
|
2024-07-31 20:23:44 +00:00
|
|
|
permissions:
|
|
|
|
checks: write # allow write access to checks to allow the action to annotate code in the PR.
|
2022-11-30 22:32:06 +00:00
|
|
|
steps:
|
2024-07-31 20:23:44 +00:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with: { fetch-depth: 0 }
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version-file: go.mod
|
|
|
|
- name: Load Version
|
|
|
|
id: load-version
|
|
|
|
run: |
|
|
|
|
GOLANGCI_VERSION=$(cat .golangci-version)
|
|
|
|
REV=$(git merge-base origin/master HEAD)
|
|
|
|
echo "GOLANGCI_VERSION=$GOLANGCI_VERSION" >> $GITHUB_ENV
|
|
|
|
echo "REV=$REV" >> $GITHUB_ENV
|
2022-11-30 22:32:06 +00:00
|
|
|
- name: golangci-lint
|
2024-07-31 20:23:44 +00:00
|
|
|
uses: golangci/golangci-lint-action@v6
|
2022-11-30 22:32:06 +00:00
|
|
|
with:
|
2024-07-31 20:23:44 +00:00
|
|
|
version: ${{ env.GOLANGCI_VERSION }}
|
|
|
|
args: -v -c .golangci.yml --new-from-rev ${{ env.REV }}
|