File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 push :
44 pull_request :
55
6+ permissions :
7+ contents : write
8+ pull-requests : write
9+
610jobs :
711 lint :
812 runs-on : ubuntu-latest
9- permissions :
10- contents : write
11-
1213 steps :
1314 - uses : actions/checkout@v5
1415 with :
@@ -20,11 +21,35 @@ jobs:
2021 go-version : 1.25.1
2122
2223 - name : Run go mod tidy
23- run : go mod tidy
24+ run : |
25+ go mod tidy
2426
2527 - name : Install & run golangci-lint
2628 uses : golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
2729 with :
2830 version : latest
2931 install-mode : " goinstall"
30- args : --fix
32+ args : --enable godot --fix
33+
34+ - name : Auto-commit lint fixes
35+ id : auto_commit
36+ if : github.event_name == 'pull_request'
37+ uses : stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
38+ with :
39+ commit_message : ' Auto-fix from ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }}'
40+
41+ - name : Comment on PR about auto-commit
42+ if : steps.auto_commit.outputs.changes_detected == 'true' && github.event_name == 'pull_request'
43+ uses : actions/github-script@v8
44+ with :
45+ script : |
46+ const runUrl = `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`
47+ const commitSha = '${{ steps.auto_commit.outputs.commit_hash }}'
48+ const commitUrl = `${{ github.server_url }}/${{ github.repository }}/commit/${commitSha}`
49+
50+ await github.rest.issues.createComment({
51+ issue_number: context.issue.number,
52+ owner: context.repo.owner,
53+ repo: context.repo.repo,
54+ body: `🤖 **Auto-fix applied**\n\nLinting fixes have been automatically committed: [${commitSha.substring(0, 7)}](${commitUrl})\n\n_From workflow run: [${runUrl}](${runUrl})_`
55+ })
Original file line number Diff line number Diff line change @@ -44,3 +44,7 @@ func NotNilPtr[T any](name string, value *T) *T {
4444 lo .Assertf (value != nil , "%s should not be a nil pointer" , name )
4545 return value
4646}
47+
48+ // bla
49+ func _ () {
50+ }
You can’t perform that action at this time.
0 commit comments