Skip to content

[CI] Add GitHub Actions workflow to trigger AzDO review pipeline - #34894

Closed
kubaflo wants to merge 1 commit into
mainfrom
feature/review-trigger-workflow
Closed

kubaflo wants to merge 1 commit into
mainfrom
feature/review-trigger-workflow

Conversation

@kubaflo

@kubaflo kubaflo commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Summary

Adds review-trigger.yml GitHub Actions workflow that enables triggering the maui-copilot AzDO pipeline (definition 27723) directly from PR comments or the Actions tab.

Usage

From a PR comment:

/review android
/review ios
/review catalyst
/review windows

From Actions tab:
Actions → "Trigger AzDO Review Pipeline" → Run workflow → Enter PR number and platform

Features

  • Permission check: Requires admin or maintain access for comment-triggered runs
  • Platform validation: Sanitizes and validates platform input (android, ios, catalyst, windows)
  • Build URL reply: Posts a comment with the AzDO build link on successful queue
  • Reaction feedback: Adds 🚀 on success or 😕 on failure to the trigger comment
  • PAT validation: Fails early with clear error if REVIEW_PR_AZDO_PAT secret is missing

Prerequisites

Requires REVIEW_PR_AZDO_PAT repository secret with an Azure DevOps PAT that has permission to queue builds on pipeline 27723 in the DevDiv project.

Context

This is the final piece from the CI Copilot pipeline work (previous PR #34575). The AzDO pipeline itself is fully operational — this workflow provides a convenient GitHub-native trigger mechanism.

Adds review-trigger.yml that enables triggering the maui-copilot
AzDO pipeline (definition 27723) from:
- PR comments: /review <platform> (android, ios, catalyst, windows)
- Manual workflow dispatch via Actions tab

Features:
- Permission check: requires admin or maintain access
- Platform validation and sanitization
- Posts reply comment with build URL on success
- Adds rocket/confused reaction to trigger comment
- Requires REVIEW_PR_AZDO_PAT secret for AzDO API auth

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kubaflo kubaflo added the area-ai-agents Copilot CLI agents, agent skills, AI-assisted development label Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 09:49
@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34894

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34894"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new GitHub Actions workflow to let maintainers trigger the maui-copilot Azure DevOps review pipeline (definition 27723) from either PR comments or manual workflow dispatch, and provides feedback back to the PR.

Changes:

  • Introduces .github/workflows/review-trigger.yml to queue an AzDO build via REST API with PRNumber + Platform parameters.
  • Adds permission gating for comment-triggered runs and posts build-link feedback (comment + reaction) back to the triggering PR comment.
  • Validates/sanitizes requested platform values before queuing.

github.repository_owner == 'dotnet' &&
(github.event_name == 'workflow_dispatch' ||
(github.event.issue.pull_request != '' &&
startsWith(github.event.comment.body, '/review')))

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The job-level condition uses startsWith(github.event.comment.body, '/review'), which will also match strings like /reviewer or /reviewed and unnecessarily run this workflow (then fail validation). Consider tightening the condition to only match the /review command (e.g., /review or /review <platform> with whitespace/end-of-string).

Suggested change
startsWith(github.event.comment.body, '/review')))
(github.event.comment.body == '/review' ||
startsWith(github.event.comment.body, '/review ') ||
startsWith(github.event.comment.body, '/review ') ||
startsWith(github.event.comment.body, '/review
'))))

Copilot uses AI. Check for mistakes.
Comment on lines +73 to +80
# Extract platform from comment: /review <platform>
PLATFORM=$(echo "$COMMENT_BODY" | sed 's|^/review[[:space:]]*||' | tr '[:upper:]' '[:lower:]' | xargs)
if [ -z "$PLATFORM" ]; then
PLATFORM="android"
fi
# Sanitize: only allow alphabetic characters
PLATFORM=$(echo "$PLATFORM" | tr -cd 'a-z')
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Platform parsing removes all non-letters from the entire remainder of the comment. If someone types /review android please the parsed platform becomes androidplease and fails validation. To make the command more robust, extract only the first token after /review (then sanitize/normalize that token).

Copilot uses AI. Check for mistakes.
@kubaflo kubaflo closed this Apr 10, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai-agents Copilot CLI agents, agent skills, AI-assisted development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants