From b9f1a0c17df139a25b69b0e7b8c0cfa2f3e556c1 Mon Sep 17 00:00:00 2001 From: 3u13r Date: Tue, 26 Sep 2023 11:15:28 +0200 Subject: [PATCH] ci: don't pull from detached head (#2335) --- .github/workflows/on-release.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index 34048a7c7d..54a64349c9 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -41,20 +41,11 @@ jobs: echo "RELEASE_BRANCH=${RELEASE_BRANCH}" | tee -a "$GITHUB_ENV" echo "WORKING_BRANCH=${WORKING_BRANCH}" | tee -a "$GITHUB_ENV" - - name: Check if we are strictly ahead of the release branch (if it exists) + - name: Create or update release branch run: | git fetch - git pull - git checkout "${RELEASE_BRANCH}" || exit 0 - git checkout "${WORKING_BRANCH}" - ahead=$(git rev-list HEAD --not "${RELEASE_BRANCH}" | wc -l) - if [[ "${ahead}" -gt 0 ]]; then - echo "The current branch is not strictly ahead of the release branch. Cannot finish transaction without touching release branch history." - exit 1 - fi - - - name: Create or update release branch - run: git push origin "${WORKING_BRANCH}":"${RELEASE_BRANCH}" + git checkout "${WORKING_BRANCH}" # ensure branch exists locally + git push origin "${WORKING_BRANCH}":"${RELEASE_BRANCH}" update: runs-on: ubuntu-22.04