mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-02 14:59:53 +08:00
* Adds bypass for lint go for RFD and Docs changes. * spacing * Update docs test to only check for docs, examples changes or bypass * include merge groups * test docs change * remove change * Test go change * remove go test change * test doc changes * remove docs test change * fix indentation * fix indentation
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
name: Lint (Go)
|
|
run-name: make lint
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- 'rfd/**'
|
|
merge_group:
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- 'rfd/**'
|
|
|
|
jobs:
|
|
lint:
|
|
if: ${{ !startsWith(github.head_ref, 'dependabot/') }}
|
|
name: Lint (Go)
|
|
runs-on: ubuntu-22.04-16core
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
container:
|
|
image: ghcr.io/gravitational/teleport-buildbox:teleport13
|
|
env:
|
|
GO_LINT_FLAGS: --timeout=15m
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Run `go mod tidy`
|
|
run: rm go.sum api/go.sum && go mod tidy && (cd api && go mod tidy)
|
|
|
|
- name: Check for changes
|
|
# We have to add the current directory as a safe directory or else git commands will not work as expected.
|
|
run: git config --global --add safe.directory $( realpath . ) && git diff --exit-code -- go.mod go.sum api/go.mod api/go.sum
|
|
|
|
- name: Run linter
|
|
run: make lint
|
|
|
|
- name: Check if protobufs are up to date
|
|
# We have to add the current directory as a safe directory or else git commands will not work as expected.
|
|
run: git config --global --add safe.directory $(realpath .) && make protos-up-to-date/host
|