diff --git a/.github/workflows/create-pr.yml b/.github/workflows/create-pr.yml index 869089c753..064a3cdd81 100644 --- a/.github/workflows/create-pr.yml +++ b/.github/workflows/create-pr.yml @@ -33,6 +33,15 @@ jobs: fetch-depth: 0 if: ${{ env.PR_BRANCH && env.BUILD_URL }} + - name: Check if branch exists already + run: | + echo "BRANCH_EXISTS=$(git show-ref --quiet refs/heads/${{ env.PR_BRANCH }} && echo 'true' || echo 'false')" >> $GITHUB_ENV + if: ${{ env.PR_BRANCH }} + + - name : machine echo env + env : { CONTENT : "${{ toJson(env) }}" } + run : "echo $CONTENT" + - name: Insert dependency uses: Wandalen/wretry.action@master id: manipulate_composer @@ -43,7 +52,7 @@ jobs: composer remove ${{ env.PACKAGE }} \ && composer require ${{ env.PACKAGE }} attempt_limit: 200 - if: ${{ env.BUILD_URL && env.PACKAGE && env.BUILD_URL_IS_ACCEPTED == 'true' }} + if: ${{ env.BRANCH_EXISTS == 'false' && env.BUILD_URL && env.PACKAGE && env.BUILD_URL_IS_ACCEPTED == 'true' }} - name: Create branch and PR id: create_pr diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62ed577898..2a4da37793 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,12 +11,15 @@ jobs: name: Test runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Testing + - name: Check if branch exists already run: | - BRANCH_EXISTS=$(git fetch origin develop || echo "John") - echo "$BRANCH_EXISTS" - # echo "BUILD_URL_IS_ACCEPTED=$BUILD_URL_IS_ACCEPTED" >> $GITHUB_ENV - - name: Testing II - run: | - echo "Hello" + echo "BRANCH_EXISTS=$(git show-ref --quiet refs/heads/humourless-satisfactory-copperbutterfly && echo 'true' || echo 'false')" >> $GITHUB_ENV + + - name : machine echo env + env : { CONTENT : "${{ toJson(env) }}" } + run : "echo $CONTENT" +