Update workflows to use Panel-stable and Panel-unstable branch names
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/e419b138-7289-46d7-b7be-6c9e455f47af Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
e2a5d3d1c4
commit
677d685e8a
2 changed files with 45 additions and 56 deletions
71
.github/workflows/promote-unstable-to-stable.yml
vendored
71
.github/workflows/promote-unstable-to-stable.yml
vendored
|
|
@ -1,15 +1,15 @@
|
|||
name: Promote Unstable to Stable
|
||||
|
||||
# This workflow is MANUAL-ONLY.
|
||||
# It overwrites the stable branch with the exact contents of unstable.
|
||||
# No merge is performed — stable becomes identical to unstable (force push).
|
||||
# It overwrites Panel-stable with the exact contents of Panel-unstable.
|
||||
# No merge is performed — Panel-stable becomes identical to Panel-unstable (force push).
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
promote:
|
||||
name: Overwrite stable with unstable
|
||||
name: Overwrite Panel-stable with Panel-unstable
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
|
|
@ -21,67 +21,68 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0 # Full history so all branches are available
|
||||
|
||||
- name: Fetch both branches
|
||||
- name: Fetch Panel-unstable and Panel-stable
|
||||
run: |
|
||||
git fetch origin unstable stable
|
||||
git fetch origin Panel-unstable Panel-stable
|
||||
|
||||
- name: Verify unstable branch exists
|
||||
- name: Verify Panel-unstable branch exists
|
||||
run: |
|
||||
if ! git rev-parse --verify origin/unstable > /dev/null 2>&1; then
|
||||
echo "ERROR: Branch 'unstable' does not exist on origin. Aborting."
|
||||
if ! git rev-parse --verify origin/Panel-unstable > /dev/null 2>&1; then
|
||||
echo "ERROR: Branch 'Panel-unstable' does not exist on origin. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
echo "Branch 'unstable' confirmed."
|
||||
echo "Branch 'Panel-unstable' confirmed."
|
||||
|
||||
- name: Verify stable branch exists
|
||||
- name: Verify Panel-stable branch exists
|
||||
run: |
|
||||
if ! git rev-parse --verify origin/stable > /dev/null 2>&1; then
|
||||
echo "ERROR: Branch 'stable' does not exist on origin. Aborting."
|
||||
if ! git rev-parse --verify origin/Panel-stable > /dev/null 2>&1; then
|
||||
echo "ERROR: Branch 'Panel-stable' does not exist on origin. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
echo "Branch 'stable' confirmed."
|
||||
echo "Branch 'Panel-stable' confirmed."
|
||||
|
||||
- name: Show current commit hashes before update
|
||||
- name: Show commit hashes before update
|
||||
run: |
|
||||
UNSTABLE_COMMIT=$(git rev-parse origin/unstable)
|
||||
STABLE_COMMIT=$(git rev-parse origin/stable)
|
||||
echo "Current unstable commit : $UNSTABLE_COMMIT"
|
||||
echo "Current stable commit : $STABLE_COMMIT"
|
||||
UNSTABLE_COMMIT=$(git rev-parse origin/Panel-unstable)
|
||||
STABLE_COMMIT=$(git rev-parse origin/Panel-stable)
|
||||
echo "Panel-unstable commit : $UNSTABLE_COMMIT"
|
||||
echo "Panel-stable commit (before) : $STABLE_COMMIT"
|
||||
echo "UNSTABLE_COMMIT=$UNSTABLE_COMMIT" >> "$GITHUB_ENV"
|
||||
echo "STABLE_BEFORE=$STABLE_COMMIT" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Check out stable locally
|
||||
- name: Check out Panel-stable locally
|
||||
run: |
|
||||
git checkout stable
|
||||
git checkout -B Panel-stable origin/Panel-stable
|
||||
|
||||
- name: Reset stable to match unstable exactly
|
||||
# This is NOT a merge. We hard-reset stable to the same commit as unstable.
|
||||
# After this step, stable and unstable are byte-for-byte identical.
|
||||
- name: Reset Panel-stable to match Panel-unstable exactly
|
||||
# This is NOT a merge. We hard-reset Panel-stable to the same commit as Panel-unstable.
|
||||
# After this step, Panel-stable and Panel-unstable are byte-for-byte identical.
|
||||
run: |
|
||||
git reset --hard origin/unstable
|
||||
git reset --hard origin/Panel-unstable
|
||||
|
||||
- name: Force push stable to origin
|
||||
# --force is intentional: we are deliberately replacing stable with unstable.
|
||||
- name: Force push Panel-stable to origin
|
||||
# --force is intentional: we are deliberately replacing Panel-stable with Panel-unstable.
|
||||
# GITHUB_TOKEN is sufficient for repositories where the actor has write access.
|
||||
run: |
|
||||
git push origin stable --force
|
||||
git push origin Panel-stable --force
|
||||
|
||||
- name: Show stable commit after update
|
||||
- name: Show Panel-stable commit after update
|
||||
run: |
|
||||
git fetch origin stable
|
||||
STABLE_AFTER=$(git rev-parse origin/stable)
|
||||
git fetch origin Panel-stable
|
||||
STABLE_AFTER=$(git rev-parse origin/Panel-stable)
|
||||
echo "-------------------------------------------"
|
||||
echo "Promotion summary"
|
||||
echo "-------------------------------------------"
|
||||
echo "unstable commit : $UNSTABLE_COMMIT"
|
||||
echo "stable commit (before) : $STABLE_BEFORE"
|
||||
echo "stable commit (after) : $STABLE_AFTER"
|
||||
echo "Panel-unstable commit : $UNSTABLE_COMMIT"
|
||||
echo "Panel-stable commit (before) : $STABLE_BEFORE"
|
||||
echo "Panel-stable commit (after) : $STABLE_AFTER"
|
||||
echo "-------------------------------------------"
|
||||
if [ "$STABLE_AFTER" = "$UNSTABLE_COMMIT" ]; then
|
||||
echo "SUCCESS: stable now matches unstable."
|
||||
echo "SUCCESS: Panel-stable now matches Panel-unstable."
|
||||
else
|
||||
echo "WARNING: stable commit does not match expected unstable commit."
|
||||
echo "WARNING: Panel-stable commit does not match expected Panel-unstable commit."
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue