From 638d24f56a4211c7e38d2461a7d1b6224a14f0e0 Mon Sep 17 00:00:00 2001 From: Manoel Campos Date: Wed, 1 Jun 2022 20:55:52 -0300 Subject: [PATCH] = Fix #28 - Command `git config --local` was causing issues The GitHub Action account email was set as global git configuration inside the container. That configuration indicates the GitHub Action bot as the author of the commits in the gh-pages branch. --- entrypoint.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 562d053..09e5551 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,9 +13,7 @@ echo "Configure git" apk add git -q > /dev/null apk add openssh-client -q > /dev/null -# Changes in gh-pages branch will be shown as the "GitHub Action" user. -git config --local user.email "action@github.com" -git config --local user.name "GitHub Action" +git config --global --add safe.directory /github/workspace # Gets latest commit hash for pushed branch COMMIT_HASH=$(git rev-parse HEAD) @@ -92,6 +90,10 @@ if [[ $INPUT_SLIDES_BUILD == true ]]; then git add -f "$SLIDES_FILE"; fi +# Changes in gh-pages branch will be shown as the "GitHub Action" user. +git config --global user.email "action@github.com" +git config --global user.name "GitHub Action" + MSG="Build $INPUT_ADOC_FILE_EXT Files for GitHub Pages from $COMMIT_HASH" git rm -rf .github/ || true echo "Committing changes to gh-pages branch"