Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,4 @@ jobs:
uses: actions/[email protected]
with:
name: jacoco-report
path: target/site/jacoco

format:
name: Format Code
permissions:
contents: write
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request.head.ref}}
fetch-depth: 0

- name: Instalar Java 25
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: 25
- name: Formatar código com Spotless
run: ./mvnw spotless:apply

- name: Faz um commit e push das mudanças
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
if ! git diff --staged --quiet; then
git commit -m "Aplica formatação do spotless"
git push
else
echo "Nenhuma mudança de formatação necessária."
fi
path: target/site/jacoco
43 changes: 43 additions & 0 deletions .github/workflows/spotless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Format Code

on:
pull_request_review:
types: [submitted]

permissions:
contents: write
pull-requests: write

jobs:
format:
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest

steps:
- name: Checkout na branch do Pull Request
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0

- name: Instalar Java 25
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25

- name: Aplicar Spotless
run: ./mvnw spotless:apply

- name: Commit e push se houver mudanças
run: |
if [[ -n "$(git status --porcelain)" ]]; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: apply spotless formatting"
git push
else
echo "Nenhuma mudança de formatação."
fi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ResponseEntity<ReminderResponseDTO> findById(@PathVariable Long id) {
return ResponseEntity.ok(reminderService.findById(id));
}

@PostMapping()
@PostMapping
public ResponseEntity<ReminderResponseDTO> create(@RequestBody @Valid CreateReminderRequestDTO dto) {
return ResponseEntity.status(HttpStatus.CREATED).body(reminderService.create(dto));
}
Expand Down