Skip to content

Commit

Permalink
Adiciona workflow para checar a formatação do código nos PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnuneslima committed Nov 19, 2024
1 parent d771cf1 commit a036293
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/gofmt-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: GoFmt Check

on:
pull_request:
branches:
- '**' # Escuta PRs para qualquer branch de destino

jobs:
gofmt:
runs-on: ubuntu-latest

steps:
# Configura o repositório
- name: Checkout repository
uses: actions/checkout@v3

# Configura o ambiente Go
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.20' # Ajuste a versão do Go conforme necessário

# Executa o gofmt para verificar formatação
- name: Run gofmt
run: |
gofmt -l .
if [ "$(gofmt -l .)" != "" ]; then
echo "⚠️ The following files need to be formatted:"
gofmt -l .
exit 1
fi

0 comments on commit a036293

Please sign in to comment.