Skip to content
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

{CI} Use OIDC to trigger extension release pipeline #7498

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update TriggerExtensionRelease.yml
  • Loading branch information
wangzelin007 committed Apr 12, 2024
commit ccf24a4a2279ab9fcc60b45bac2ee53bc49d4d7c
24 changes: 16 additions & 8 deletions .github/workflows/TriggerExtensionRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

permissions:
contents: read
id-token: write

jobs:
build:
Expand All @@ -19,12 +20,19 @@ jobs:
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Azure Pipelines Action
uses: Azure/pipelines@v1.2
- name: Azure login
uses: azure/login@v2
with:
azure-devops-project-url: https://dev.azure.com/azclitools/release
azure-pipeline-name: 'azure-cli-extensions-release'
# 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 }}"}'
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:
inlineScript: |
az pipelines build queue --definition-id ${{ env.ado-pipeline-id }} --organization ${{ env.ado-org }} --project ${{ env.ado-project }} --variables commit_id=${{ env.commit-id }}