From 6d04e2afa95f021680f52b5918b2e2285e7b886f Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Tue, 21 May 2024 19:45:58 +0200 Subject: [PATCH] Testing... --- .github/workflows/create-pr.yml | 10 ++++++++-- .github/workflows/test.yml | 17 +++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/create-pr.yml b/.github/workflows/create-pr.yml index 869089c75..b49d7af1a 100644 --- a/.github/workflows/create-pr.yml +++ b/.github/workflows/create-pr.yml @@ -28,10 +28,16 @@ jobs: if: ${{ github.event.action == 'create_pr' && github.event.client_payload.branch && github.event.client_payload.build_url && github.event.client_payload.dependency_package }} + - id: check_branch_exists + uses: GuillaumeFalourd/branch-exists@v1 + with: + branch: ${{ env.PR_BRANCH }} + if: ${{ env.PR_BRANCH }} + - uses: actions/checkout@v4 with: fetch-depth: 0 - if: ${{ env.PR_BRANCH && env.BUILD_URL }} + if: ${{ steps.check_branch_exists.outputs.exists == 'false' }} - name: Insert dependency uses: Wandalen/wretry.action@master @@ -43,7 +49,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: ${{ steps.check_branch_exists.outputs.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 62ed57789..c0ef46911 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,12 +11,13 @@ jobs: name: Test runs-on: ubuntu-latest steps: + - id: check-branch-exists + uses: GuillaumeFalourd/branch-exists@v1 + with: + branch: humourless-satisfactory-copperbutterfly - - name: Testing - 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" + - if: steps.check-branch-exists.outputs.exists == 'true' + run: echo 'humourless-satisfactory-copperbutterfly Branch exists' + + - if: steps.check-branch-exists.outputs.exists == 'false' + run: echo 'humourless-satisfactory-copperbutterfly Branch NOT FOUND'