Skip to content

Commit

Permalink
{CI} Use GitHub Actions to trigger the ADO OneBranch Extension Releas…
Browse files Browse the repository at this point in the history
…e Pipeline (Azure#7439)

* Create TriggerExtensionRelease.yml

* Update TriggerExtensionRelease.yml

* Update TriggerExtensionRelease.yml
  • Loading branch information
wangzelin007 authored Apr 1, 2024
1 parent 99d98a0 commit c580ff9
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/TriggerExtensionRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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

# 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

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 Pipelines Action
uses: Azure/pipelines@v1.2
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 }}"}'
- name: Wait for Extension Release
# azure-cli-extensions-release.yml + azure-cli-extensions-sync-after-release.yml ~= 20 minutes
run: sleep 1200

0 comments on commit c580ff9

Please sign in to comment.