mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
ci: fix ahead-check for working branch (#2120)
Also list remote branches during on-release
This commit is contained in:
parent
ac575c9a2c
commit
c58d03a7b8
4
.github/workflows/on-release.yml
vendored
4
.github/workflows/on-release.yml
vendored
@ -35,14 +35,14 @@ jobs:
|
||||
PART_MINOR=${WITHOUT_V#*.}
|
||||
MAJOR_MINOR=${PART_MAJOR}.${PART_MINOR}
|
||||
RELEASE_BRANCH="release/v${MAJOR_MINOR}"
|
||||
WORKING_BRANCH_PREFIX="tmp/${FULL_VERSION}"
|
||||
WORKING_BRANCH_PREFIX="origin/tmp/${FULL_VERSION}"
|
||||
echo "RELEASE_BRANCH=${RELEASE_BRANCH}" | tee -a "$GITHUB_ENV"
|
||||
echo "WORKING_BRANCH_PREFIX=${WORKING_BRANCH_PREFIX}" | tee -a "$GITHUB_ENV"
|
||||
|
||||
- name: Find temporary branch
|
||||
id: find-temporary-branch
|
||||
run: |
|
||||
working_branch_count=$(git branch --list "${WORKING_BRANCH_PREFIX}*" | wc -l)
|
||||
working_branch_count=$(git branch --list -r "${WORKING_BRANCH_PREFIX}*" | wc -l)
|
||||
if [[ "${working_branch_count}" -ne 1 ]]; then
|
||||
echo "More than one (or zero) temporary branches found. Cannot finish transaction."
|
||||
git branch --list "${WORKING_BRANCH_PREFIX}*"
|
||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -131,7 +131,7 @@ jobs:
|
||||
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
|
||||
if [[ "${ahead}" -eq 0 ]]; then
|
||||
echo "The current branch is not strictly ahead of the release branch. Please rebase."
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user