Skip to content

Commit 4e28434

Browse files
Trigger Azure DevOps extension release (#9781)
1 parent 2fad37c commit 4e28434

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,3 +700,48 @@ jobs:
700700
is_stable: ${{ needs.compute-release-context.outputs.is_stable }}
701701
is_active_major: ${{ needs.compute-release-context.outputs.is_active_major }}
702702
token: ${{ steps.app-token.outputs.token }}
703+
704+
update-azure-pipelines-extension:
705+
name: 🔄 Update Azure Pipelines Extension
706+
runs-on: ubuntu-latest
707+
needs: [compute-release-context, publish-release]
708+
if: needs.compute-release-context.outputs.is_stable == 'true'
709+
710+
steps:
711+
- name: 🔐 Create GitHub App token
712+
id: app-token
713+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3
714+
with:
715+
app-id: ${{ secrets.ACTIONS_APP_ID }}
716+
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
717+
owner: ChilliCream
718+
repositories: nitro-azure-pipelines-tasks
719+
720+
- name: 🚀 Dispatch extension release workflow
721+
id: dispatch
722+
env:
723+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
724+
REPO: ChilliCream/nitro-azure-pipelines-tasks
725+
VERSION: ${{ needs.compute-release-context.outputs.git_tag }}
726+
IS_ACTIVE_MAJOR: ${{ needs.compute-release-context.outputs.is_active_major }}
727+
shell: bash
728+
run: |
729+
set -euo pipefail
730+
RUN_URL=$(gh workflow run release.yaml --repo "$REPO" --ref main \
731+
-f version="$VERSION" \
732+
-f is_active_major="$IS_ACTIVE_MAJOR")
733+
if [ -z "$RUN_URL" ]; then
734+
echo "::error::Dispatch did not return a run URL. Requires gh >= 2.87.0."
735+
exit 1
736+
fi
737+
RUN_ID="${RUN_URL##*/}"
738+
echo "run-id=$RUN_ID" >> "$GITHUB_OUTPUT"
739+
echo "Dispatched run: $RUN_URL"
740+
741+
- name: 👀 Watch extension release run
742+
env:
743+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
744+
REPO: ChilliCream/nitro-azure-pipelines-tasks
745+
RUN_ID: ${{ steps.dispatch.outputs.run-id }}
746+
shell: bash
747+
run: gh run watch "$RUN_ID" --repo "$REPO" --exit-status --compact

0 commit comments

Comments
 (0)