From 769dfd6282d48e26e1a9ffb3a08181f87c837426 Mon Sep 17 00:00:00 2001 From: Salima Hassouni <141415851+sahassou@users.noreply.github.com> Date: Fri, 17 May 2024 13:14:40 +0200 Subject: [PATCH] Ops 6495 fix issue playwright test (#35) * OPS-6495-print the exit status of the if statement * OPS-6495-determine whether the branch exists or not using --exit-code command * OPS-6495-determine whether the branch exists or not using --exit-code command * OPS-6495-Verify whether using GITHUB_ENV is more appropriate for setting environment variables, as GITHUB_OUTPUT * OPS-6495-use GITHUB_OUTPUT instaed of GITHUB_ENV * OPS-6495-clean the workflow --- .github/workflows/deploy.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 418b359..44a7879 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -254,16 +254,16 @@ jobs: - name: Check current branch run: | echo "Current branch: ${{ github.ref_name }}" - - name: Check if Playwright branch exists id: check_branch run: | playwright_branch="${{ github.ref_name }}" - if git ls-remote --heads https://github.com/dBildungsplattform/schulportal-testautomatisierung $playwright_branch &> /dev/null; then + if git ls-remote --heads --exit-code https://github.com/dBildungsplattform/schulportal-testautomatisierung $playwright_branch &> /dev/null; then echo "playwright_branch=$playwright_branch" >> $GITHUB_OUTPUT else echo "playwright_branch=main" >> $GITHUB_OUTPUT fi + echo "Branch exists: $?" run_playwright_tests: needs: @@ -274,5 +274,4 @@ jobs: secrets: inherit with: frontendHostname: "${{ needs.create_lowercase_ingress_prefix.outputs.namespace_from_branch }}.dev.spsh.dbildungsplattform.de" - playwright_branch: ${{ needs.determine_playwright_branch.outputs.playwright_branch || fromJSON('{"value":"main"}').value }} - \ No newline at end of file + playwright_branch: ${{ needs.determine_playwright_branch.outputs.playwright_branch || 'main' }} \ No newline at end of file