@@ -100,24 +100,31 @@ jobs:
100100 # Derive the short SHA from the provided commit
101101 git_short_sha=$(git rev-parse --short "$COMMIT_SHA")
102102
103- # Get the PR Number tag
104- PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number')
103+ # Get the PR Info
104+
105+ PR_INFO=$(gh api repos/${{ github.repository }}/commits/${COMMIT_SHA}/pulls --jq '.[0] | {number: .number, branch: .head.ref}')
106+ PR_NUM=$(echo "$PR_INFO" | jq -r '.number')
107+ BRANCH_NAME=$(echo "$PR_INFO" | jq -r '.branch')
108+
109+ # PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number')
105110 DEVTEST_PR_NUM_TAG="devtest_pr${PR_NUM}"
111+ echo "Detected Branch: ${BRANCH_NAME}"
106112 echo "Devtest_PR_Num_tag: ${DEVTEST_PR_NUM_TAG}"
107113
108114 # Prepare parameters as separate key=value tokens
109115 param_image="dockerImageTag=${DEVTEST_PR_NUM_TAG}"
110116 param_tests="testTypes=[${test_types[$ENVIRONMENT_NAME]}]"
111117
112118 echo "Starting Azure devops pipeline \"Deploy to Azure - Core ${ENVIRONMENT_NAME}\"..."
113- RUN_ID=$(az pipelines run \
114- --commit-id "$COMMIT_SHA" \
115- --name "Deploy to Azure - Core ${ENVIRONMENT_NAME}" \
116- --org "${organisation}" \
117- --project "${project_name}" \
118- --parameters "$param_image" "$param_tests" \
119- --output tsv --query id)
120-
121- echo "Click here to view the ADO pipeline: ${organisation}/${project_name}/_build/results?buildId=${RUN_ID}"
122-
123- scripts/bash/wait_ado_pipeline.sh "$RUN_ID" "${organisation}" "${project_name}" 1800
119+ # RUN_ID=$(az pipelines run \
120+ # --branch "${BRANCH_NAME}" \
121+ # --commit-id "$COMMIT_SHA" \
122+ # --name "Deploy to Azure - Core ${ENVIRONMENT_NAME}" \
123+ # --org "${organisation}" \
124+ # --project "${project_name}" \
125+ # --parameters "$param_image" "$param_tests" \
126+ # --output tsv --query id)
127+
128+ # echo "Click here to view the ADO pipeline: ${organisation}/${project_name}/_build/results?buildId=${RUN_ID}"
129+
130+ # scripts/bash/wait_ado_pipeline.sh "$RUN_ID" "${organisation}" "${project_name}" 1800
0 commit comments