Repository navigation
Conversation
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>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34894Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34894" |
There was a problem hiding this comment.
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.ymlto queue an AzDO build via REST API withPRNumber+Platformparameters. - 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'))) |
There was a problem hiding this comment.
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).
| 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 | |
| ')))) |
| # 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" |
There was a problem hiding this comment.
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).
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.ymlGitHub Actions workflow that enables triggering themaui-copilotAzDO pipeline (definition 27723) directly from PR comments or the Actions tab.Usage
From a PR comment:
From Actions tab:
Actions → "Trigger AzDO Review Pipeline" → Run workflow → Enter PR number and platform
Features
adminormaintainaccess for comment-triggered runsREVIEW_PR_AZDO_PATsecret is missingPrerequisites
Requires
REVIEW_PR_AZDO_PATrepository 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.