Skip to content

Restrict GitHub workflows to microsoft/aspire - #20722

Merged
Ankit Jain (radical) merged 14 commits into
mainfrom
copilot/restrict-workflows-to-microsoft-aspire
Oct 14, 2026
Merged

Ankit Jain (radical) merged 14 commits into
mainfrom
copilot/restrict-workflows-to-microsoft-aspire

Conversation

Copilot AI commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

GitHub Actions jobs should run only in microsoft/aspire, but repository-owner checks also allow other repositories under the same organization, and some jobs have no repository guard.

Use exact repository checks across direct and reusable workflows, including agentic workflow sources and generated locks. Narrow GITHUB_TOKEN permissions on test workflows and update the related CI documentation.

if: ${{ github.repository == 'microsoft/aspire' }}

Remove five tests that asserted literal YAML strings and were changed only to match the new repository conditions. These expectations duplicate configuration rather than exercise workflow behavior. Existing behavioral Node harness tests remain; untouched YAML assertions are outside this cleanup.

Validation on macOS arm64: the following command passed all 41 remaining tests in the three affected classes (0 failed, 0 skipped):

dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --no-launch-profile -- --filter-class '*.BackportWorkflowTests' --filter-class '*.DeploymentTestCommandTests' --filter-class '*.ExtensionWorkflowTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

git --no-pager diff --check also passed. These local tests do not validate GitHub Actions repository gating end to end.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Copilot AI and others added 6 commits October 4, 2026 03:27
Co-authored-by: radical <1472+radical@users.noreply.github.com>
Co-authored-by: radical <1472+radical@users.noreply.github.com>
Co-authored-by: radical <1472+radical@users.noreply.github.com>
Co-authored-by: radical <1472+radical@users.noreply.github.com>
Co-authored-by: radical <1472+radical@users.noreply.github.com>
Co-authored-by: radical <1472+radical@users.noreply.github.com>
@radical

Copy link
Copy Markdown
Member

Copilot do we really need this on every job? Shouldn't it be on every workflow?

Copilot AI commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Copilot do we really need this on every job? Shouldn't it be on every workflow?

GitHub Actions doesn’t support a workflow-level if; conditions are available on jobs and steps. A single gate job could be used as a dependency, but every runnable job would need to depend on it, and jobs using always() or reusable workflows need careful handling. The per-job checks are explicit and ensure each job is skipped before it consumes a runner or does work.

@radical

Copy link
Copy Markdown
Member

Copilot Don't modify the labeler workflows, those are being used as-is.

Co-authored-by: radical <1472+radical@users.noreply.github.com>

Copilot AI commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Copilot Don't modify the labeler workflows, those are being used as-is.

Reverted all labeler workflow changes to their pre-PR state in ae3b3a7.

@github-actions

github-actions Bot commented Oct 4, 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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20722

Or

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

Comment thread .github/workflows/polyglot-validation.yml Fixed
@radical Ankit Jain (radical) added shepherd-adopted [automated] CI Shepherd may drive this item within the bounded trial. and removed shepherd-adopted [automated] CI Shepherd may drive this item within the bounded trial. labels Oct 4, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Co-authored-by: radical <1472+radical@users.noreply.github.com>
@radical Ankit Jain (radical) removed the shepherd-adopted [automated] CI Shepherd may drive this item within the bounded trial. label Oct 5, 2026
…flows-to-microsoft-aspire

# Conflicts:
#	.github/workflows/milestone-changelog.lock.yml

Co-authored-by: radical <1472+radical@users.noreply.github.com>
Five workflow tests assert literal YAML conditions rather than behavior.
Changing the repository guards requires rewriting those expectations
without demonstrating that the workflows run correctly.

Remove those five tests. Retain behavioral Node harness tests,
untouched assertions, and shared helpers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 401f795f-42c1-4ff5-929a-2b40840c86a6
@github-actions

This comment has been minimized.

@radical
Ankit Jain (radical) enabled auto-merge (squash) October 13, 2026 16:31
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Bring the PR up to current main while preserving its workflow repository
guards. The merge resolves cleanly without additional product changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 74ccba9f-30ce-4acd-ab34-cde9555081fb
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

Selects the full PR test matrix + all PR-gated jobs (ALL) — a rule matching '.github/workflows/run-tests.yml' selects ALL


Selection computed for commit ae7ec0b.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-engineering-systems infrastructure helix infra engineering repo stuff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants