From feb4aaac0349e39871a1ee2f6bf6cd264a4abaa2 Mon Sep 17 00:00:00 2001 From: fithwum Date: Sun, 11 Jan 2026 06:43:09 -0800 Subject: [PATCH] test --- .gitea/workflows/pipeline.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml index 9204e5d..8f99ed3 100644 --- a/.gitea/workflows/pipeline.yml +++ b/.gitea/workflows/pipeline.yml @@ -393,10 +393,28 @@ jobs: run: | git config user.name "${{ secrets.GIT_USERNAME }}" git config user.email "${{ secrets.GIT_EMAIL }}" + if git status --porcelain | grep .; then + # Create a temporary branch + TEMP_BRANCH="tmp-changelog-$(date -u +%s)" + git checkout -b "$TEMP_BRANCH" + git add */CHANGES.md git commit -m "Update changelogs on $(date -u +'%Y-%m-%dT%H:%M:%SZ')" --no-verify - git push + + # Push temporary branch + git push origin "$TEMP_BRANCH" + + # Merge temporary branch into main safely + git checkout main + git fetch origin main + git merge --no-ff --no-edit "$TEMP_BRANCH" + + # Push main branch + git push origin main + + # Delete temporary branch remotely + git push origin --delete "$TEMP_BRANCH" || true else echo "[INFO] No changelog changes to commit." fi \ No newline at end of file