mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
280255acae
This adds an initial and intentionally minimal configuration for golang-ci, fixes the issues reported, and adds a GitHub Action to check new pull requests against this linter configuration. Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I8f38fbc315836a19a094d0d3e986758b9313f163
41 lines
914 B
YAML
41 lines
914 B
YAML
name: golangci-lint
|
|
on:
|
|
# For now, only lint pull requests, not the main branches.
|
|
pull_request:
|
|
|
|
# TODO(andrew): enable for main branch after an initial waiting period.
|
|
#push:
|
|
# branches:
|
|
# - main
|
|
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
golangci:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: false
|
|
|
|
- name: golangci-lint
|
|
# Note: this is the 'v3' tag as of 2023-04-17
|
|
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5
|
|
with:
|
|
version: v1.52.2
|
|
|
|
# Show only new issues if it's a pull request.
|
|
only-new-issues: true
|