Skip to content

Commit

Permalink
Create lint-fix.yml
Browse files Browse the repository at this point in the history
Signed-off-by: gitworkflows <[email protected]>
  • Loading branch information
gitworkflows authored Nov 23, 2024
1 parent 5eb3eb9 commit 3a11df3
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/lint-fix.yml
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

0 comments on commit 3a11df3

Please sign in to comment.