-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: gitworkflows <[email protected]>
- Loading branch information
1 parent
5eb3eb9
commit 3a11df3
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: 🙏🏻 Lint Test | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
paths: | ||
- '**/*.go' # Only run on Go files | ||
permissions: | ||
contents: write # Write permission needed for autofix | ||
pull-requests: write | ||
|
||
jobs: | ||
golangci: | ||
name: Run golangci-lint with Autofix | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Required for creating commits in the repo | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
cache-dependency-path: go.sum | ||
- uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.52 | ||
cache: true | ||
skip-cache: false | ||
args: --fix --timeout 10m --verbose | ||
- name: Commit and Push Changes | ||
if: success() # Only push changes if the linting succeeds | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "Autofix: Applied golangci-lint fixes" | ||
git push |