Skip to content

Commit d76868f

Browse files
committed
ci(deploy): normalize bare branch ref to origin/<branch>
1 parent f7ebe73 commit d76868f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
set -euo pipefail
3333
cd /opt/openstudy
3434
REF="${{ github.event.inputs.ref || github.ref_name }}"
35+
# Normalize bare branch names to origin/<branch> so the reset
36+
# picks up the freshly-fetched commits, not the stale local branch.
37+
if [[ "$REF" != origin/* && "$REF" != v* ]]; then
38+
REF="origin/$REF"
39+
fi
3540
echo "Deploying ref: $REF"
3641
git fetch --all --tags
3742
git reset --hard "$REF"

0 commit comments

Comments
 (0)