Skip to content

Commit

Permalink
chore(build): add golangci-lint to the pipeline as a non-blocking step (
Browse files Browse the repository at this point in the history
#742)

* let's see what this does

* copy on block from commitlint

* take longer

* the same thing, but maybe correctly this time

* now that its mostly working we can let it report errors

* this is just cheating

* gosec will be in its own workflow

* Update .github/workflows/golangci-lint.yaml

Co-authored-by: Brandt Keller <[email protected]>

---------

Co-authored-by: Brandt Keller <[email protected]>
  • Loading branch information
mildwonkey and brandtkeller authored Oct 18, 2024
1 parent bcb2ab0 commit fedb0c9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches: [main]
# milestoned is added here as a workaround for release-please not triggering PR workflows (PRs should be added to a milestone to trigger the workflow).
types: [milestoned, opened, reopened, synchronize]
types: [milestoned, opened, reopened, synchronize, edit]

permissions:
contents: read
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: golangci-lint
on:
pull_request:
branches:
- main
types: [milestoned, opened, reopened, synchronize]

permissions:
contents: read
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: Setup golang
uses: ./.github/actions/golang

- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
args: --timeout=5m
6 changes: 6 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
linters:
# all default linters enabled
enable:
- gofmt
- goimports
- prealloc

0 comments on commit fedb0c9

Please sign in to comment.