Skip to content

Commit

Permalink
Prevent local git client from getting out of sync
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiharju committed Sep 2, 2024
1 parent 5289fbd commit 0aac394
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ set -eu
./scripts/g-docs/commit.sh "
via .githooks/pre-push"

# Without the below, local git client will think it's 1 commit ahead of origin after push
# if the docs were updated by the GitHub Actions bot via this hook.
if [ "$(git log -1 --pretty=format:"%cn")" = "github-actions[bot]" ]; then
git push
git pull
fi

0 comments on commit 0aac394

Please sign in to comment.