forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4aea784
commit e537a96
Showing
1 changed file
with
15 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -10,14 +10,6 @@ on: | |
permissions: | ||
contents: read | ||
|
||
# This is the only solution to trigger OneBranch pipeline from a GitHub commit。 | ||
# But it lacks batch CI support, we have to use concurrency to prevent earlier commits task overwriting index.json from later ones。 | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | ||
concurrency: | ||
group: trigger-extension-release | ||
# By default, there can be at most one running and one pending job in a concurrency group at any time. | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
name: Trigger Extension Release Pipeline | ||
|
@@ -27,16 +19,19 @@ jobs: | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | ||
with: | ||
egress-policy: audit | ||
- name: Azure Pipelines Action | ||
uses: Azure/[email protected] | ||
- 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: Azure CLI | ||
uses: azure/cli@v2 | ||
env: | ||
ado-org: ${{secrets.ADO_ORGANIZATION}} | ||
ado-project: ${{secrets.ADO_PROJECT}} | ||
ado-pipeline-id: ${{secrets.ADO_PIPELINE_ID}} | ||
commit-id: ${{ github.sha }} | ||
with: | ||
azure-devops-project-url: https://dev.azure.com/azclitools/internal | ||
azure-pipeline-name: 'testOneBranchCLI-Official' | ||
# https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows | ||
# expire on 2024/9/21 | ||
azure-devops-token: ${{ secrets.ONE_BRANCH_TOKEN }} | ||
# azure-pipeline-variables: '{"commit_id": "${{ github.sha }}"}' | ||
azure-pipeline-variables: '{"commit_id": "cd149b7c50dbac2e3124ef1743a3270a727998ca"}' | ||
- name: Wait for Extension Release | ||
# azure-cli-extensions-release.yml + azure-cli-extensions-sync-after-release.yml ~= 20 minutes | ||
run: sleep 1200 | ||
inlineScript: | | ||
az pipelines build queue --definition-id $ado-pipeline-id --organization $ado-org --project $ado-pipeline-id --variables '{"commit_id": "$commit-id"}' |