33 push :
44 pull_request :
55
6+ permissions :
7+ contents : write
8+ pull-requests : write
9+
610jobs :
711 lint :
12+ name : Lint w/ golangci-lint
813 runs-on : ubuntu-latest
9- permissions :
10- contents : write
11-
1214 steps :
1315 - uses : actions/checkout@v5
1416 with :
@@ -20,11 +22,44 @@ jobs:
2022 go-version : 1.25.1
2123
2224 - name : Run go mod tidy
23- run : go mod tidy
25+ run : |
26+ go mod tidy
2427
2528 - name : Install & run golangci-lint
2629 uses : golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
2730 with :
2831 version : latest
2932 install-mode : " goinstall"
30- args : --fix
33+
34+ args : --enable godot --fix
35+
36+ - name : Auto-commit lint fixes
37+ id : auto_commit
38+ if : github.event_name == 'pull_request'
39+ uses : stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
40+ with :
41+ status_options : --untracked-files=no
42+
43+ commit_message : Auto-fix from ${{ github.workflow }} / ${{ github.job }} job
44+ commit_user_name : Stefan Zimmermann
45+ commit_user_email : user@zimmermann.co
46+ commit_author : Stefan Zimmermann <user@zimmermann.co>
47+ commit_options : --signoff
48+
49+ - name : Comment on PR about the auto-commit
50+ if : github.event_name == 'pull_request' && steps.auto_commit.outputs.changes_detected == 'true'
51+ uses : actions/github-script@v8
52+ with :
53+ script : |
54+ const repositoryUrl = '${{ github.server_url }}/${{ github.repository }}'
55+
56+ github.rest.issues.createComment({
57+ issue_number: context.issue.number,
58+ owner: context.repo.owner,
59+ repo: context.repo.repo,
60+ body: `
61+ **Auto-fix applied from ${{ github.workflow }}** / \`${{ github.job }}\` job
62+
63+ * Workflow run: ${repositoryUrl}/actions/runs/${{ github.run_id }}
64+ * Fix commit: ${repositoryUrl}/commit/${{ steps.auto_commit.outputs.commit_hash }}
65+ `})
0 commit comments