Post dogfood comment only after packages are successfully built#16248
Draft
Post dogfood comment only after packages are successfully built#16248
Conversation
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/0fe2cd20-63e2-43d0-ba4d-ec5fc171da52 Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update dogfood comment workflow to trigger on workflow_dispatch
Post dogfood comment only after packages are successfully built
Apr 16, 2026
- Add contents: read to the tests job permissions block in ci.yml, preventing 403 errors on actions/checkout (when permissions: is set, unspecified scopes default to none). - Replace exit_code=$? pattern with || in the dogfood dispatch step. Bash runs with set -e by default in Actions, so the old pattern was dead code — the warning annotation would never be emitted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16248Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16248" |
Replace the dispatch-from-tests.yml approach with a workflow_run trigger on dogfood-comment.yml. workflow_run always runs in the base repo context with write permissions, so dogfood comments now work for fork PRs too. - Remove prNumber plumbing from ci.yml and tests.yml - Add workflow_run trigger watching CI workflow completion - Query jobs API to verify build_packages succeeded before posting - Use commits API to resolve PR number (works for forks) - Pass all event data through env vars to prevent template injection (fixes zizmor template-injection findings) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
eebdc34 to
cbf7e07
Compare
- Add dogfood_comment job in tests.yml that posts after build_packages for same-repo PRs (earlier than waiting for full CI completion) - Restrict dogfood-comment.yml to fork PRs only via head_repository check - Replace update-or-create pattern with skip-if-exists dedup in both paths - Use continue-on-error: true so comment failures don't break CI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🎬 CLI E2E Test Recordings — 36 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #24541901576 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dogfood comment was being posted immediately on PR open/sync via
pull_request_target, before any packages were built — and was posted even for doc-only PRs where no packages are built at all.Changes
dogfood-comment.ymlpull_request_targettriggerworkflow_runtrigger watching theCIworkflow — this runs in the base repo context with full write permissions, so it works for both same-repo and fork PRsactions/github-script) is unchanged, but now usesprocess.env.PR_NUMBERto avoid template injectionworkflow_dispatchtrigger for manual use / testingenv:vars instead of inline${{ }}expressions to prevent template injection (satisfies zizmor audit)How it works
ci.yml→ callstests.yml→ builds packages, runs testsCIworkflow completes,workflow_runfiresdogfood-comment.ymlin the base repo contextBuild packagesjob succeeded (so doc-only PRs and failed builds are skipped)workflow_runalways runs on the default branch in the base repository, sopull-requests: writeworks correctly for fork PRs without needingpull_request_target.Checklist