Added formatting workflow

This commit is contained in:
Ceferino Patino 2024-12-01 19:55:25 -06:00
commit 45b57dc0ef
Signed by: c4patino
SSH key fingerprint: SHA256:Wu+cU1t+7zVT9wzew/4meNmeulo66NzMqc22MdDBgXI
2 changed files with 54 additions and 0 deletions

32
.github/workflows/format.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: gofmt + zls
on:
push:
branches: ["main"]
tags: ["v*.*.*"]
pull_request:
types: [opened, reopened, synchronize]
branches: ["*"]
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup go
uses: actions/setup-go@v5
- name: Format all go files
run: (cd ./2024/go/ && go fmt ./...)
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: |
Autoformatting with gofmt + zls
[skip ci]