From 09241e0fd8d1cdf7b2246892a8e1f0609574308c Mon Sep 17 00:00:00 2001 From: JuanfeSanahuja Date: Wed, 2 Oct 2024 14:42:39 +0200 Subject: [PATCH] cicd: Fix calculating opencga branch in pull request approve workflow #TASK-6981 --- .github/workflows/test-xetabase-workflow.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-xetabase-workflow.yml b/.github/workflows/test-xetabase-workflow.yml index ed802879..57445f9a 100644 --- a/.github/workflows/test-xetabase-workflow.yml +++ b/.github/workflows/test-xetabase-workflow.yml @@ -51,13 +51,18 @@ jobs: path: opencga-enterprise fetch-depth: "10" - id: get_opencga_branch - name: Get OpenCGA branch from 'pom.xml' property + name: Get OpenCGA branch run: | - pwd - ls -lrtha - ls -lrtha ./opencga-enterprise - chmod +x ./opencga-enterprise/.github/workflows/scripts/get-opencga-xetabase-branch.sh - opencga_branch=$(./opencga-enterprise/.github/workflows/scripts/get-opencga-xetabase-branch.sh) + # If the task exists in the opencga repository, this is the branch to be tested + if [[ "${{ inputs.task }}" == TASK* ]]; then + if [ "$(git ls-remote "https://github.com/opencb/opencga.git" "${{ inputs.task }}" ] ; then + opencga_branch="${{ inputs.task }}"; + return 0; + fi + else + chmod +x ./opencga-enterprise/.github/workflows/scripts/get-opencga-xetabase-branch.sh + opencga_branch=$(./opencga-enterprise/.github/workflows/scripts/get-opencga-xetabase-branch.sh) + fi echo "opencga_branch=${opencga_branch}" echo "opencga_branch=${opencga_branch}" >> $GITHUB_OUTPUT - name: Clone OpenCGA branch '${{ steps.get_opencga_branch.outputs.opencga_branch }}'