Skip to content

Commit f8509ec

Browse files
Merge d2ab90a into 1d9ec21
2 parents 1d9ec21 + d2ab90a commit f8509ec

2 files changed

Lines changed: 37 additions & 5 deletions

File tree

.github/workflows/linting.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ on:
33
push:
44
pull_request:
55

6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
610
jobs:
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,38 @@ 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.workflow }}/${{ github.job }} job
40+
commit_user_name: github-actions[bot]
41+
commit_user_email: noreply@github.com
42+
push_options: --force
43+
44+
- name: Comment on PR about auto-commit
45+
if: github.event_name == 'pull_request' && steps.auto_commit.outputs.changes_detected == 'true'
46+
uses: actions/github-script@v8
47+
with:
48+
script: |
49+
github.rest.issues.createComment({
50+
issue_number: context.issue.number,
51+
owner: context.repo.owner,
52+
repo: context.repo.repo,
53+
body: `
54+
**Auto-fix applied from ${{ github.workflow }}/${{ github.job }} job**
55+
56+
* Workflow run: ${{ github.repositoryUrl }}/actions/runs/${{ github.run_id }}
57+
* Fix commit: ${{ github.repositoryUrl }}/commit/${{ steps.auto_commit.outputs.commit_hash }}
58+
`})

pointer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)