From c3bac048fccd6dbe2cba07a0b7cb1c20e8c36014 Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Tue, 17 Feb 2026 22:04:52 +0100 Subject: [PATCH] handle multiple commits --- .gitea/workflows/update-child-repos.yaml | 2 +- update_child_repos.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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=""