Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 23, 2025

OGP画像生成問題の調査と修正

問題の原因

PR #255the-deadline ブランチでOGP画像が生成されているが、CIでコミットされない問題を調査しました。

根本原因:

  1. git diff --exit-code コマンドが新しく追加されたファイル(untracked files)を検出できない
    • git diff は既存ファイルの変更のみを検出し、新規ファイルは検出しない
  2. Bashのデフォルト設定では ** パターンが再帰的にマッチしない
    • content/**/cover.pngcontent/*/cover.png として扱われ、サブディレクトリのファイルがマッチしない

修正内容

  • 問題の原因を特定
  • ワークフローを修正:
    • git add でファイルをステージングしてから git diff --cached --quiet --exit-code で変更を検出
    • shopt -s globstar を追加して ** パターンを正しく展開
    • 新規ファイルと変更ファイルの両方を検出可能に
  • 修正をテスト(ローカルで動作確認完了)
  • コードレビューを実施(フィードバック反映済み)
  • セキュリティチェックを実施(問題なし)

テスト結果

# 修正前: has_changes=false(新規ファイルが検出されない)
# 修正後: has_changes=true(新規ファイルが正しく検出される)

Security Summary

CodeQLによるセキュリティスキャンを実施しました。脆弱性は検出されませんでした。

Original prompt

ogpが生成されないので調査して。


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits November 23, 2025 02:31
- git diffではなくgit addした後にgit diff --cachedを使用して、新規ファイルと変更ファイルの両方を検出
- content/about/cover.pngも明示的に含めるように修正

Co-authored-by: kyu08 <[email protected]>
- shopt -s globstarを追加して、content/**/cover.pngパターンが再帰的にマッチするように修正
- content/about/cover.pngは content/**/cover.png に含まれるため、明示的な指定を削除

Co-authored-by: kyu08 <[email protected]>
- git diff --cached --quiet --exit-codeの条件を反転させて、より読みやすく変更

Co-authored-by: kyu08 <[email protected]>
@kyu08 kyu08 marked this pull request as ready for review November 23, 2025 02:39
Copilot AI requested a review from kyu08 November 23, 2025 02:39
@kyu08 kyu08 changed the title [WIP] Investigate issue with OGP generation OGP生成が行われない問題を修正 Nov 23, 2025
@kyu08 kyu08 changed the title OGP生成が行われない問題を修正 OGP生成がcommitされない問題を修正 Nov 23, 2025
@kyu08 kyu08 changed the title OGP生成がcommitされない問題を修正 OGP画像がcommitされない問題を修正 Nov 23, 2025
@kyu08 kyu08 merged commit f0709fa into main Nov 23, 2025
@kyu08 kyu08 deleted the copilot/investigate-ogp-generation-issue branch November 23, 2025 02:40
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.

2 participants