mirror of
https://github.com/tailscale/tailscale.git
synced 2026-01-05 01:11:39 +00:00
Restrict running the golangci-lint workflow to when the workflow file itself or a .go file, go.mod, or go.sum have actually been modified. Updates #cleanup Signed-off-by: Mario Minardi <mario@tailscale.com>
44 lines
1.0 KiB
YAML
44 lines
1.0 KiB
YAML
name: golangci-lint
|
|
on:
|
|
# For now, only lint pull requests, not the main branches.
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/golangci-lint.yml"
|
|
- "**.go"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
# 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: false
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
|
|
with:
|
|
version: v2.4.0
|
|
|
|
# Show only new issues if it's a pull request.
|
|
only-new-issues: true
|