Skip to content

Commit 3b9ad55

Browse files
authored
build: fix non-fast-forward push in publish_coverage_pr
PR-URL: #13393 Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 669fa61 commit 3b9ad55

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/publish_coverage_pr.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,11 @@ jobs:
157157
run: |
158158
cd ./www-test-code-coverage
159159
BRANCH_NAME="pr-$PR_NUMBER"
160-
git fetch origin "$BRANCH_NAME" || true
161-
git checkout "$BRANCH_NAME" || git checkout -b "$BRANCH_NAME"
160+
if git fetch origin "$BRANCH_NAME"; then
161+
git checkout -B "$BRANCH_NAME" FETCH_HEAD
162+
else
163+
git checkout -b "$BRANCH_NAME"
164+
fi
162165
163166
# Remove all directories except .github and .git from branch:
164167
find . -mindepth 1 -maxdepth 1 -type d -not -name '.github' -not -name '.git' -exec git rm -rf {} + || true

0 commit comments

Comments
 (0)