Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new GitHub Actions workflow to automatically format Go code using go fmt when Go files in the backend directory are pushed to any branch. The workflow will automatically commit and push formatting changes if any are detected.
Changes:
- Added
.github/workflows/go-fmt.ymlto rungo fmton backend Go files and auto-commit formatting changes on push events - Configured the workflow with write permissions to enable automatic commits
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| branches: | ||
| - main | ||
| paths: | ||
| - "backend/**/*.go" |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "backend/**/*.go" |
There was a problem hiding this comment.
The PR description states this workflow runs "任意のブランチへのプッシュ時" (on push to any branch), but the actual trigger is "pull_request" targeting only the "main" branch. This is a significant discrepancy. If the intention is to run on push events to any branch, the trigger should be:
on:
push:
paths:
- "backend/**/*.go"If the intention is to run only on pull requests to main, the PR description should be updated to reflect this.
| - name: Run go fmt | ||
| working-directory: ./backend | ||
| run: | | ||
| go fmt ./... | ||
| git diff --exit-code |
There was a problem hiding this comment.
The PR description states that if there are differences after running "go fmt", the workflow will "自動コミット&プッシュ" (automatically commit and push). However, the actual workflow only runs "git diff --exit-code", which will fail the workflow if there are any formatting differences. It does not automatically commit or push any changes.
If the intention is to verify formatting (fail if not formatted), the PR description should be updated. If the intention is to auto-format and commit, additional steps are needed to commit and push the changes back to the branch.
変更内容