ci: auto-discover root *.slnx in CI workflows#411
Merged
Conversation
Replace hardcoded MyBlog.slnx with a discovery step that finds exactly one root-level *.slnx file, exports it as SOLUTION_FILE via GITHUB_ENV, and uses that variable for restore/build. Fails with a clear error if zero or multiple solution files are found at the repo root.
Contributor
🏗️ PR Added to Squad Triage QueueThis PR has been labeled with Next steps:
|
There was a problem hiding this comment.
Pull request overview
Updates the CI workflows to avoid hardcoding MyBlog.slnx by discovering the single root-level *.slnx at runtime and using it for restore/build commands.
Changes:
- Added a “Discover solution file” step (finds exactly one root
*.slnx, fails if zero/multiple, exportsSOLUTION_FILE). - Updated restore/build steps in both workflows to use
"$SOLUTION_FILE"instead of a hardcoded solution name. squad-ci.ymlalso narrows the branch filters forpull_request/pushtriggers (not mentioned in the PR description/issue).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/squad-test.yml | Adds solution discovery in the build job and uses the discovered solution for restore/build. |
| .github/workflows/squad-ci.yml | Adds solution discovery and switches restore/build to the discovered solution; also changes workflow trigger branch filters. |
Comment on lines
4
to
+9
| on: | ||
| pull_request: | ||
| branches: [dev, preview, main, insider] | ||
| branches: [dev, main] | ||
| types: [opened, synchronize, reopened] | ||
| push: | ||
| branches: [dev, insider] | ||
| branches: [dev] |
Comment on lines
2
to
+6
| # Runs on PR to main branch — mirrors pre-push gate (build only, no tests) | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev, preview, main, insider] | ||
| branches: [dev, main] |
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #411 +/- ##
=======================================
Coverage 87.49% 87.49%
=======================================
Files 71 71
Lines 1775 1775
Branches 214 214
=======================================
Hits 1553 1553
Misses 145 145
Partials 77 77 🚀 New features to boost your workflow:
|
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.
Closes #410
Changes
Replace hardcoded \MyBlog.slnx\ in both CI workflows with a discovery step that interrogates the repo at runtime.
squad-ci.yml / squad-test.yml
Both workflows are now drop-in reusable across any repo with a single root-level .slnx\ file.