ci: don't pull from detached head (#2335)

This commit is contained in:
3u13r 2023-09-26 11:15:28 +02:00 committed by GitHub
parent b45c01da9e
commit b9f1a0c17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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