-
Notifications
You must be signed in to change notification settings - Fork 1.5k
{CI} Add a test workflow to trigger test extension release pipeline on main branch push #9158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wangzelin007
merged 3 commits into
Azure:main
from
wangzelin007:wzl/unified_ame_storage
Sep 16, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
112ca42
Add workflow to trigger Test Extension Release Pipeline on main branc…
wangzelin007 8bb8bad
Add a test pipeline to perform a dry run release of new external exte…
wangzelin007 5c81c32
Update .github/workflows/TestTriggerExtensionRelease.yml
wangzelin007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: Trigger ADO OneBranch Extension Release Pipeline | ||
|
|
||
| # Run this workflow every time a commit gets pushed to main | ||
| # This triggers the ADO OneBranch Extension Release Pipeline | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Trigger Extension Release Pipeline | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | ||
| with: | ||
| egress-policy: audit | ||
| - name: Azure login | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.ADO_SP_ClientID }} | ||
| tenant-id: ${{ secrets.ADO_SP_TenantID }} | ||
| allow-no-subscriptions: true | ||
| - name: Trigger ADO Pipeline and Wait for Completion | ||
| uses: azure/cli@v2 | ||
| env: | ||
| ado-org: ${{secrets.ADO_ORGANIZATION}} | ||
| ado-project: ${{secrets.ADO_PROJECT}} | ||
| ado-pipeline-id: 396380 | ||
| commit-id: ${{ github.sha }} | ||
| with: | ||
| inlineScript: | | ||
| # Trigger the pipeline and capture the build ID | ||
| echo "Triggering ADO pipeline..." | ||
| BUILD_RESULT=$(az pipelines build queue \ | ||
| --definition-id ${{ env.ado-pipeline-id }} \ | ||
| --organization ${{ env.ado-org }} \ | ||
| --project ${{ env.ado-project }} \ | ||
| --variables commit_id=${{ env.commit-id }} \ | ||
| --output json) | ||
|
|
||
| BUILD_ID=$(echo $BUILD_RESULT | jq -r '.id') | ||
| echo "Pipeline triggered with Build ID: $BUILD_ID" | ||
|
|
||
| if [ "$BUILD_ID" = "null" ] || [ -z "$BUILD_ID" ]; then | ||
| echo "Failed to get build ID from pipeline trigger" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Wait for the build to complete | ||
| echo "Waiting for build $BUILD_ID to complete..." | ||
| while true; do | ||
wangzelin007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| BUILD_JSON=$(az pipelines build show \ | ||
| --id $BUILD_ID \ | ||
| --organization ${{ env.ado-org }} \ | ||
| --project ${{ env.ado-project }} \ | ||
| --output json) | ||
|
|
||
| BUILD_STATUS=$(echo "$BUILD_JSON" | jq -r '.status') | ||
| BUILD_RESULT_STATUS=$(echo "$BUILD_JSON" | jq -r '.result // "none"') | ||
|
|
||
| echo "Current status: $BUILD_STATUS, Result: $BUILD_RESULT_STATUS" | ||
|
|
||
| # Check if build is completed | ||
| if [ "$BUILD_STATUS" = "completed" ]; then | ||
| echo "Build completed with result: $BUILD_RESULT_STATUS" | ||
|
|
||
| # Check if the build was successful | ||
| if [ "$BUILD_RESULT_STATUS" = "succeeded" ]; then | ||
| echo "✅ ADO pipeline build succeeded!" | ||
| exit 0 | ||
| elif [ "$BUILD_RESULT_STATUS" = "partiallySucceeded" ]; then | ||
| echo "⚠️ ADO pipeline build partially succeeded" | ||
| exit 1 | ||
| else | ||
| echo "❌ ADO pipeline build failed with result: $BUILD_RESULT_STATUS" | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| # Check for other terminal states | ||
| if [ "$BUILD_STATUS" = "cancelling" ] || [ "$BUILD_STATUS" = "cancelled" ]; then | ||
| echo "❌ ADO pipeline build was cancelled" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Wait 30 seconds before checking again | ||
| echo "Build still running... waiting 30 seconds" | ||
| sleep 30 | ||
| done | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.