mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-06 13:26:26 +00:00
main branch will read go version from go.mod's go primitive, and only keep major and minor version, because we want the actions to use the lastest patch version automatically, even the go.mod specify version like 1.24.0. release branch can read the go version from go.mod file by setup-go action's own logic. Refactor the get Go version to reusable workflow. Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
33 lines
785 B
YAML
33 lines
785 B
YAML
name: Pull Request Linter Check
|
|
on:
|
|
pull_request:
|
|
# Do not run when the change only includes these directories.
|
|
paths-ignore:
|
|
- "site/**"
|
|
- "design/**"
|
|
- "**/*.md"
|
|
jobs:
|
|
get-go-version:
|
|
uses: ./.github/workflows/get-go-version.yaml
|
|
with:
|
|
ref: ${{ github.event.pull_request.base.ref }}
|
|
|
|
build:
|
|
name: Run Linter Check
|
|
runs-on: ubuntu-latest
|
|
needs: get-go-version
|
|
steps:
|
|
- name: Check out the code
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Set up Go version
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: ${{ needs.get-go-version.outputs.version }}
|
|
|
|
- name: Linter check
|
|
uses: golangci/golangci-lint-action@v8
|
|
with:
|
|
version: v2.1.1
|
|
args: --verbose
|