Repository navigation
Description
The problem
I tried to run pre-commit hooks below.
#!/bin/sh
# コミット対象の編集された.xlsxファイルを取得
xlsx_files=$(git diff --cached --name-only --diff-filter=ACM | grep '\.xlsx$')
# .xlsxファイルがある場合はCheckSheetConflictを実行
if [ -n "$xlsx_files" ]; then
echo "Checking sheet conflicts for: $xlsx_files"
# publishディレクトリのパスを取得
repo_root=$(git rev-parse --show-toplevel)
publish_dir="$repo_root/hoge/publish/mac"
# Check if publish directory exists
if [ ! -d "$publish_dir" ]; then
echo "Error: Publish directory not found: $publish_dir"
exit 1
fi
executable="$publish_dir/hoge"
# CheckSheetConflictを実行
"$executable" CheckSheetConflict $xlsx_files
# 実行結果を確認
if [ $? -ne 0 ]; then
echo "CheckSheetConflict failed. Commit aborted."
exit 1
fi
echo "CheckSheetConflict passed."
fi
exit 0When I try to commit by CLI, this hook run successfully, but by desktop, this hooks didn't run and commit passed in any situation.
"executable" contains google oauth, and googlr api access.
Release version
3.5.4
Operating system
macOS
Steps to reproduce the behavior
No response
Log files
No response
Screenshots
No response
Additional context
No response
Yesterday we shipped GitHub Desktop 3.5.5-beta1 to our beta channel with improved support for hooks related to committing.
The support is experimental and currently limited to our beta channel. While we believe that this release resolved this issue we're looking for real-world feedback so if you have the ability we'd appreciate it if you could download our beta channel and give it a spin. Ensure the experimental hooks support it's enabled by going to Settings -> Git -> Hooks and making sure the "Load Git hook environment variables from shell" is ticked.
Activity
niik commentedon Jan 14, 2026
Yesterday we shipped GitHub Desktop 3.5.5-beta1 to our beta channel with improved support for hooks related to committing.
The support is experimental and currently limited to our beta channel. While we believe that this release resolved this issue we're looking for real-world feedback so if you have the ability we'd appreciate it if you could download our beta channel and give it a spin. Ensure the experimental hooks support it's enabled by going to Settings -> Git -> Hooks and making sure the "Load Git hook environment variables from shell" is ticked.