mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-25 11:46:06 +02:00
ci: use original commiter author instead of actor (#310)
* ci: use original commiter author instead of actor * Update sync-to-mirrors.sh * Update sync-to-mirrors.sh * Update sync-to-mirrors.sh
This commit is contained in:
@@ -40,7 +40,8 @@ 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" )
|
||||
fi
|
||||
COMMIT_ORIGINAL_AUTHOR="${GITHUB_ACTOR} <${GITHUB_ACTOR}@users.noreply.github.com>"
|
||||
COMMIT_ACTOR="${GITHUB_ACTOR} <${GITHUB_ACTOR}@users.noreply.github.com>"
|
||||
COMMIT_AUTHOR=$(cd "${SOURCE_DIR:-.}" &&git show -s --format="%an <%ae>" $GITHUB_SHA)
|
||||
|
||||
if [[ "$GITHUB_REF" =~ ^refs/heads/ ]]; then
|
||||
BRANCH=${GITHUB_REF#refs/heads/}
|
||||
@@ -98,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_ORIGINAL_AUTHOR}" -m "${COMMIT_MESSAGE}" &&
|
||||
if git commit $FORCE_COMMIT --author="${COMMIT_AUTHOR}" -m "${COMMIT_MESSAGE}\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"
|
||||
@@ -114,4 +115,4 @@ while read -r PLUGIN_NAME; do
|
||||
fi
|
||||
done < "$BUILD_BASE/mirrors.txt"
|
||||
|
||||
exit $EXIT
|
||||
exit $EXIT
|
||||
|
||||
Reference in New Issue
Block a user