Skip to content

ci: プッシュ時にgo fmtを自動実行するワークフローを追加#14

Merged
wwwkah merged 4 commits into
mainfrom
test/ci
Mar 3, 2026
Merged

ci: プッシュ時にgo fmtを自動実行するワークフローを追加#14
wwwkah merged 4 commits into
mainfrom
test/ci

Conversation

@wwwkah
Copy link
Copy Markdown
Contributor

@wwwkah wwwkah commented Feb 19, 2026

変更内容

  • \go-fmt.yml\ を新規追加: 任意のブランチへのプッシュ時に \�ackend/**/*.go\ に変更があれば \go fmt ./...\ を実行し、差分があれば自動コミット&プッシュ
  • \�erify-openapi.yml\ はテスト用トリガーを削除し、元のPRトリガーのみに戻した

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml to run go fmt on 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.

@Lumos-Programming Lumos-Programming deleted a comment from Copilot AI Feb 19, 2026
@Lumos-Programming Lumos-Programming deleted a comment from Copilot AI Feb 19, 2026
branches:
- main
paths:
- "backend/**/*.go"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mainにpushされた時の条件を追加して欲しいかも

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +2 to +7
on:
pull_request:
branches:
- main
paths:
- "backend/**/*.go"
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +23
- name: Run go fmt
working-directory: ./backend
run: |
go fmt ./...
git diff --exit-code
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@Shion1305 Shion1305 self-requested a review February 19, 2026 19:05
@wwwkah wwwkah merged commit 1c23aff into main Mar 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants