diff --git a/.github/sync-to-mirrors.sh b/.github/sync-to-mirrors.sh index 7ede1f53..311a6fb3 100755 --- a/.github/sync-to-mirrors.sh +++ b/.github/sync-to-mirrors.sh @@ -38,7 +38,7 @@ fi if [[ -z "$COMMIT_MESSAGE" ]]; then MONOREPO_COMMIT_MESSAGE=$(cd "${SOURCE_DIR:-.}" && git show -s --format=%B $GITHUB_SHA) - COMMIT_MESSAGE=$( printf "%s\n\nCommitted via a GitHub action: https://github.com/%s/actions/runs/%s\n" "$MONOREPO_COMMIT_MESSAGE" "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" ) + COMMIT_MESSAGE=$( printf "%s\n\nCommitted via a GitHub action: https://github.com/%s/actions/runs/%s" "$MONOREPO_COMMIT_MESSAGE" "$GITHUB_REPOSITORY" "$GITHUB_RUN_ID" ) fi COMMIT_ACTOR="${GITHUB_ACTOR} <${GITHUB_ACTOR}@users.noreply.github.com>" COMMIT_AUTHOR=$(cd "${SOURCE_DIR:-.}" &&git show -s --format="%an <%ae>" $GITHUB_SHA) @@ -99,7 +99,7 @@ while read -r PLUGIN_NAME; do if [[ -n "$FORCE_COMMIT" || -n "$(git status --porcelain)" ]]; then echo "Committing to $PLUGIN_NAME" - if git commit $FORCE_COMMIT --author="${COMMIT_AUTHOR}" -m "${COMMIT_MESSAGE}\nCo-authored-by: ${COMMIT_ACTOR}" && + if git commit $FORCE_COMMIT --author="${COMMIT_AUTHOR}" -m "${COMMIT_MESSAGE} \n\nCo-authored-by: ${COMMIT_ACTOR}" && { [[ -z "$CI" ]] || git push origin "$BRANCH"; } # Only do the actual push from the GitHub Action then # echo "$BUILD_BASE/changes.diff"