Skip to content

chore: Tooling Deps #960

chore: Tooling Deps

chore: Tooling Deps #960

Workflow file for this run

name: Go Fmt
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
permissions:
contents: write
pull-requests: write
jobs:
gofmt:
if: "!contains(github.event.pull_request.labels.*.name, 'no-fmt')"
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.25.5]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Run Formatter
run: git ls-files '*.go' | xargs gofmt -w -s
- name: Commit Formatting Changes
if: github.event.pull_request.head.repo.full_name == github.repository
uses: stefanzweifel/[email protected]
with:
commit_message: apply coding style fixes
commit_options: '--no-verify'
file_pattern: .
repository: .
commit_user_name: GitHub Actions
commit_user_email: ${{ secrets.GUS_GH_EMAIL }}
commit_author: gocanto <[email protected]>
branch: ${{ github.event.pull_request.head.ref }}