Skip to content

Commit 44667de

Browse files
fix(ci): keep a stable fork-sync branch (#3)
1 parent 994123d commit 44667de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/fork-sync-upstream.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ jobs:
6767
id: prep
6868
run: |
6969
set -euo pipefail
70-
stamp="$(date -u +%Y%m%d-%H%M%S)"
7170
upstream_sha="$(git rev-parse --short "upstream/${UPSTREAM_BRANCH}")"
72-
sync_branch="sync/${UPSTREAM_BRANCH}-${stamp}-${upstream_sha}"
71+
safe_patch="$(echo "${PATCH_BRANCH}" | tr '/' '-')"
72+
safe_upstream="$(echo "${UPSTREAM_BRANCH}" | tr '/' '-')"
73+
sync_branch="sync/${safe_patch}-onto-${safe_upstream}"
7374
git checkout -B "$sync_branch" "origin/${PATCH_BRANCH}"
7475
echo "sync_branch=$sync_branch" >> "$GITHUB_OUTPUT"
7576
echo "upstream_sha=$upstream_sha" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)