Skip to content

Commit

Permalink
Testing...
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceo committed May 21, 2024
1 parent 90114fc commit 1ddd580
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/create-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 1ddd580

Please sign in to comment.