Skip to content

Commit

Permalink
Update trigger-onebranch-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lilgreenbird authored Dec 19, 2024
1 parent 3c1ad3d commit 51e82e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/trigger-onebranch-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up GitHub environment variables
run: |
# Extract the PR number from the GitHub reference (GITHUB_REF)
pr_id=$(echo $GITHUB_REF | awk -F'/' '{print $3}')
echo "PR_ID=$pr_id" >> $GITHUB_ENV
# Step 1: Trigger the Azure DevOps Pipeline
- name: Trigger Azure DevOps Pipeline
id: trigger-pipeline
run: |
response=$(curl -u :${{ secrets.AZURE_DEVOPS_TOKEN }} \
-X POST \
-H "Content-Type: application/json" \
-d "{\"definition\": {\"id\": \"1548\"}, \"sourceBranch\": \"refs/pull/${{ github.event.pull_request.number }}/merge\"}" \
-d "{\"definition\": {\"id\": \"1548\"}, \"sourceBranch\": \"refs/pull/$PR_ID/merge\"}" \
https://dev.azure.com/SqlClientDrivers/mssql-jdbc/_apis/build/builds?api-version=6.0)
echo "Response: $response"
Expand Down

0 comments on commit 51e82e9

Please sign in to comment.