From 4866268aa2eb681a648f012b809b6d54c14eb334 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Mon, 18 Nov 2024 11:23:05 +0100 Subject: [PATCH] Workaround protected branches --- .github/workflows/release-start.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-start.yml b/.github/workflows/release-start.yml index 15c9a11057..d68fbc01e2 100644 --- a/.github/workflows/release-start.yml +++ b/.github/workflows/release-start.yml @@ -26,6 +26,7 @@ jobs: env: RELEASE_VERSION: ${{ inputs.release_version_name }} RELEASE_BRANCH: 'release/${{ inputs.release_version_name }}' + TEMP_RELEASE_BRANCH: 'tmp_release/${{ inputs.release_version_name }}' steps: - name: Check out code @@ -41,9 +42,8 @@ jobs: # override vName with new version - name: Create release branch run: | - git config --list - git checkout -b ${{ env.RELEASE_BRANCH }} - git push origin ${{ env.RELEASE_BRANCH }} + git checkout -b ${{ env.TEMP_RELEASE_BRANCH }} + git push origin ${{ env.TEMP_RELEASE_BRANCH }} - name: Run Python script to update release branch version run: python scripts/updateVersionName.py ${{ env.RELEASE_VERSION }} @@ -52,9 +52,15 @@ jobs: uses: flex-development/gh-commit@1.0.0 with: message: 'Update version to ${{ env.RELEASE_VERSION }}' - ref: ${{ env.RELEASE_BRANCH }} + ref: ${{ env.TEMP_RELEASE_BRANCH }} token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} + - name: Change to release branch + run: | + git checkout -b ${{ env.RELEASE_BRANCH }} + git push origin ${{ env.RELEASE_BRANCH }} + git push origin --delete ${{ env.TEMP_RELEASE_BRANCH }} + update_version: if: false # The type of runner that the job will run on