Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit 22fcf4a

Browse files
Merge pull request #100 from hmcts/adotrigger
Use ADO Trigger v1 and apply to release pipeline
2 parents 02f1e32 + bbdeb65 commit 22fcf4a

File tree

2 files changed

+18
-30
lines changed

2 files changed

+18
-30
lines changed

.github/workflows/ci-draft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
135135
136136
- name: Trigger ADO pipeline
137-
uses: hmcts/trigger-ado-pipeline@v1.0.3
137+
uses: hmcts/trigger-ado-pipeline@v1
138138
with:
139139
pipeline_id: 460 #cp-gh-artifact-to-acr
140140
ado_pat: ${{ secrets.HMCTS_ADO_PAT }}

.github/workflows/ci-released.yml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -113,35 +113,23 @@ jobs:
113113
Deploy:
114114
needs: [ Build, Artefact-Version ]
115115
runs-on: ubuntu-latest
116+
if: github.event_name == 'push'
116117

117118
steps:
118-
- name: Trigger ADO pipeline
119-
env:
120-
ADO_ORG: 'hmcts-cpp'
121-
ADO_PROJECT: 'cpp-apps'
122-
PIPELINE_ID: 460 #cp-gh-artifact-to-acr
123-
ADO_PAT: ${{ secrets.HMCTS_ADO_PAT }}
124-
ARTEFACT_VERSION: ${{ needs.Artefact-Version.outputs.artefact_version }}
119+
- name: Extract repo name
120+
id: extract_repo
125121
run: |
126-
REPO_NAME="${GITHUB_REPOSITORY##*/}"
127-
TARGET_REPOSITORY="${GITHUB_REPOSITORY}"
128-
129-
curl -X POST \
130-
-u ":${ADO_PAT}" \
131-
-H "Content-Type: application/json" \
132-
https://dev.azure.com/${ADO_ORG}/${ADO_PROJECT}/_apis/pipelines/${PIPELINE_ID}/runs?api-version=7.0 \
133-
-d "{
134-
\"resources\": {
135-
\"repositories\": {
136-
\"self\": {
137-
\"refName\": \"refs/heads/main\"
138-
}
139-
}
140-
},
141-
\"templateParameters\": {
142-
\"GROUP_ID\": \"uk.gov.hmcts.cp\",
143-
\"ARTIFACT_ID\": \"${REPO_NAME}\",
144-
\"ARTIFACT_VERSION\": \"${ARTEFACT_VERSION}\",
145-
\"TARGET_REPOSITORY\": \"${TARGET_REPOSITORY}\"
146-
}
147-
}"
122+
echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
123+
124+
- name: Trigger ADO pipeline
125+
uses: hmcts/trigger-ado-pipeline@v1
126+
with:
127+
pipeline_id: 460 #cp-gh-artifact-to-acr
128+
ado_pat: ${{ secrets.HMCTS_ADO_PAT }}
129+
template_parameters: >
130+
{
131+
"GROUP_ID": "uk.gov.hmcts.cp",
132+
"ARTIFACT_ID": "${{ env.REPO_NAME }}",
133+
"ARTIFACT_VERSION": "${{ needs.Artefact-Version.outputs.artefact_version }}",
134+
"TARGET_REPOSITORY": "${{ github.repository }}"
135+
}

0 commit comments

Comments
 (0)