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,42 @@ 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+
33+ args : --enable godot --fix
34+
35+ - name : Auto-commit lint fixes
36+ id : auto_commit
37+ if : github.event_name == 'pull_request'
38+ uses : stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
39+ with :
40+ status_options : --untracked-files=no
41+
42+ commit_message : Auto-fix from ${{ github.workflow }} / ${{ github.job }} job
43+ commit_user_name : github-actions[bot]
44+ commit_user_email : noreply@github.com
45+
46+ - name : Comment on PR about the auto-commit
47+ if : github.event_name == 'pull_request' && steps.auto_commit.outputs.changes_detected == 'true'
48+ uses : actions/github-script@v8
49+ with :
50+ script : |
51+ const repositoryUrl = '${{ github.server_url }}/${{ github.repository }}'
52+
53+ github.rest.issues.createComment({
54+ issue_number: context.issue.number,
55+ owner: context.repo.owner,
56+ repo: context.repo.repo,
57+ body: `
58+ **Auto-fix applied from ${{ github.workflow_ref }}** / \`${{ github.job }}\` job
59+
60+ * Workflow run: ${repositoryUrl}/actions/runs/${{ github.run_id }}
61+ * Fix commit: ${repositoryUrl}/commit/${{ steps.auto_commit.outputs.commit_hash }}
62+ `})
0 commit comments