Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/build-docusaurus-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ jobs:
container: zepben/pipeline-basic
outputs:
git_tag: ${{ steps.tags.outputs.git_tag }}
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
steps:

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ env.GITHUB_TOKEN }}

- name: Work around git permission issue
run: |
Expand All @@ -88,15 +89,8 @@ jobs:

- name: Delete release branch
run: |
# If the `release` branch already exists, remove it
# disable error failing
set +e
res=$(git push origin -d release)
if [ $? != 0 ]; then
echo "> [!NOTE] " >> "$GITHUB_STEP_SUMMARY"
echo "> :white_check_mark: Error while deleting 'release' branch in *parse-inputs* step, but that's probably OK. If nothing else failed, you're good." >> "$GITHUB_STEP_SUMMARY"
fi
continue-on-error: true
source /scripts/common.sh
clear_release_branch
shell: bash

- name: Create release branch
Expand Down
12 changes: 2 additions & 10 deletions pipelines/basic/scripts/release-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,8 @@ do
fi
done

info "Clearing the 'release' branch if it exists, ignore errors"
run git push origin -d release
# In most cases the error here means that the "release" branch doesn't exist.
# If that's not the case, one the following steps will fail, and will be handled
# manually, so we ignore the error here and only showing it.
if [ $status -ne 0 ]; then
# Show the error and continue
echo "Warning: There was an error deleting a release branch: "
cat "${output_file}"
fi
info "Clearing the 'release' branch if it exists"
clear_release_branch

# Get user name
if [[ -z "$BITBUCKET_STEP_TRIGGERER_UUID" ]]; then
Expand Down
9 changes: 9 additions & 0 deletions pipelines/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ tag_finalize_version() {
run git push --tags
}

clear_release_branch() {
info "Clearing 'release' branch"

run git ls-remote --exit-code --heads origin release >/dev/null 2>&1
if [[ $? == '0' ]]; then
run git push origin -d release
fi
}

check_tag_exists() {
version=${1:? 'Version variable is missing.'}
info "Checking remote tags if version exists..."
Expand Down