From dc4218761fd8122b3d14b7ae4add6c2c5f8c1fe7 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 23 Jun 2023 13:25:54 -0400 Subject: [PATCH] .github: only run go lint when go changes --- .github/workflows/lint.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 81b2bb2662..51698c4542 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,9 +13,22 @@ on: # yamllint disable-line rule:truthy env: GO_VERSION: "~1.20.5" jobs: + go-filter: + runs-on: "ubuntu-latest" + outputs: + gochange: "${{ steps.code-filter.outputs.gochange }}" + steps: + - uses: "actions/checkout@v3" + - uses: "dorny/paths-filter@v2" + id: "go-filter" + with: + filters: | + gochange: + - "**.go" go-lint: name: "Lint Go" runs-on: "ubuntu-latest" + if: "needs.paths-filter.outputs.gochange == 'true'" steps: - uses: "actions/checkout@v3" - uses: "authzed/actions/setup-go@main" @@ -43,6 +56,7 @@ jobs: codeql: name: "Analyze with CodeQL" runs-on: "ubuntu-latest-8-cores" + if: "needs.paths-filter.outputs.gochange == 'true'" permissions: actions: "read" contents: "read"