From f4e94761ad1499b1613668acd813f95487b98040 Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 22 Oct 2023 20:09:43 +0100 Subject: [PATCH] .................... --- .gitea/workflows/pr-closed.yml | 52 +++++++++++++--------------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/.gitea/workflows/pr-closed.yml b/.gitea/workflows/pr-closed.yml index c581cdf..8b80ba8 100644 --- a/.gitea/workflows/pr-closed.yml +++ b/.gitea/workflows/pr-closed.yml @@ -6,6 +6,26 @@ on: - closed jobs: + delete: + runs-on: ubuntu-latest + steps: + - uses: http://sigyl.com:3000/actions/checkout@v3.5.4 + with: + token: ${{ secrets.BOT_TOKEN }} + - name: delete develop branch + id: delete_develop_branch + run: git push origin --delete ${{ github.head_ref }} + continue-on-error: true + - uses: mainmatter/continue-on-error-comment@v1 + with: + repo-token: ${{ github.token }} + outcome: ${{ steps.delete_develop_branch.outcome }} + test-id: Error code ${{ matrix.code }} + - name: get build branch name + run: | + firstString=${{ github.head_ref }} + secondString="build-" + echo ::set-env name=BUILD_BRANCH::${firstString/develop-/"$secondString"} if_merged: if: github.event.pull_request.merged == true runs-on: ubuntu-latest @@ -13,14 +33,6 @@ jobs: - uses: http://sigyl.com:3000/actions/checkout@v3.5.4 with: token: ${{ secrets.BOT_TOKEN }} - - name: on-merge - run: | - echo The PR was merged into ${{ github.event.pull_request.base.ref }} from ${{ github.ref_name }} from ${{ github.ref }} type ${{ github.ref_type }} - echo head ref : ${{ github.event.pull_request.head.ref }} - echo base_ref : ${{ github.base_ref }} - echo head_ref : ${{ github.head_ref }} - echo env: ${{ env.GITHUB_HEAD_REF }} - echo env: ${{ env.GITHUB_BASE_REF }} - name: delete develop branch id: delete_develop_branch run: git push origin --delete ${{ github.head_ref }} @@ -35,27 +47,3 @@ jobs: firstString=${{ github.head_ref }} secondString="build-" echo ::set-env name=BUILD_BRANCH::${firstString/develop-/"$secondString"} - - name: delete build branch - id: delete_build_branch - run: git push origin --delete ${{ env.BUILD_BRANCH }} - continue-on-error: true - - uses: mainmatter/continue-on-error-comment@v1 - with: - repo-token: ${{ github.token }} - outcome: ${{ steps.delete_build_branch.outcome }} - test-id: Error code ${{ matrix.code }} - - name: get build format branch name - run: | - firstString=${{ github.head_ref }} - secondString="format-" - echo ::set-env name=FORMAT_BRANCH::${firstString/develop-/"$secondString"} - - name: delete format branch - id: delete_format_branch - run: git push origin --delete ${{ env.FORMAT_BRANCH }} - continue-on-error: true - - uses: mainmatter/continue-on-error-comment@v1 - with: - repo-token: ${{ github.token }} - outcome: ${{ steps.delete_format_branch.outcome }} - test-id: Error code ${{ matrix.code }} - \ No newline at end of file