Skip to content

Commit

Permalink
.github: only run go lint when go changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Jun 23, 2023
1 parent 3f02d1a commit dc42187
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit dc42187

Please sign in to comment.