diff --git a/.gitea/workflows/update-child-repos.yaml b/.gitea/workflows/update-child-repos.yaml index 9f2eb13..edf9ee8 100644 --- a/.gitea/workflows/update-child-repos.yaml +++ b/.gitea/workflows/update-child-repos.yaml @@ -25,7 +25,7 @@ jobs: git config --global user.email "${GIT_EMAIL}" git config --global credential.helper store echo "https://${GIT_EMAIL//@/%40}:${GIT_TOKEN}@git.bjphoster.com" > ~/.git-credentials - ./update_child_repos.sh + ./update_child_repos.sh "${{ github.event.before }}" env: GIT_NAME: ${{ secrets.GIT_NAME }} GIT_EMAIL: ${{ secrets.GIT_EMAIL }} diff --git a/update_child_repos.sh b/update_child_repos.sh index a11984b..a130095 100755 --- a/update_child_repos.sh +++ b/update_child_repos.sh @@ -14,7 +14,11 @@ TEMPLATE_BRANCH="main" CURRENT_COMMIT_ID=$(git rev-parse HEAD) COMMIT_MESSAGE="Template updates (commit: ${CURRENT_COMMIT_ID:0:7})" -PREVIOUS_COMMIT_ID=$(git log --format="%H" -n 2 HEAD | tail -n 1) +PREVIOUS_COMMIT_ID="${1:-}" + +if [ -z "${PREVIOUS_COMMIT_ID}" ]; then + PREVIOUS_COMMIT_ID=$(git log --format="%H" -n 2 HEAD | tail -n 1) +fi if [ "${PREVIOUS_COMMIT_ID}" = "${CURRENT_COMMIT_ID}" ]; then FILES_CHANGED=""