Gate the sep-check in prettier CI check to changes in ecosystem folder only#1905
Gate the sep-check in prettier CI check to changes in ecosystem folder only#1905anupsdf merged 4 commits intostellar:masterfrom
Conversation
|
Tested with making CAP and SEP file changes and confirmed that with this change, prettier only runs for files changes in ecosystem folder. sep-check was skipped by prettier when only cap changes were present: sep-check ran when there were SEP changes in ecosystem/*.md file: |
bboston7
left a comment
There was a problem hiding this comment.
Thanks for fixing this!
There was a problem hiding this comment.
Pull request overview
Updates the Prettier GitHub Actions workflow so the SEP formatting check is only executed when SEP markdown files under ecosystem/ are modified, avoiding unnecessary yarn sep-check runs for CAP-only PRs.
Changes:
- Fetch full git history and compute whether
ecosystem/*.mdchanged between PR base/head SHAs. - Conditionally run Node setup +
yarn sep-checkonly when SEP markdown changes are detected. - Emit a “skipping” message when no SEP markdown changes are present.
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
fetch-depth: 0 will fetch full history and can noticeably slow this CI job. For a PR workflow checked out at the merge commit, fetch-depth: 2 is typically sufficient to have both base.sha and head.sha available for the git diff, reducing network/time cost.
| fetch-depth: 0 | |
| fetch-depth: 2 |
| - id: sep-changes | ||
| shell: bash | ||
| run: | | ||
| if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" | grep -Eq '^ecosystem/[^/]+\.md$'; then | ||
| echo 'sep=true' >> "$GITHUB_OUTPUT" | ||
| else |
There was a problem hiding this comment.
The job still schedules on every PR and then decides whether to run via git diff. If the goal is to run this workflow only when ecosystem/ changes, consider using a pull_request.paths filter (e.g., ecosystem/**) to avoid spinning up a runner at all; that would also remove the need for the sep-changes diff step and full-history checkout.
There was a problem hiding this comment.
Good suggestion. Since this PR is merged already, I will create a new PR for this recommendation.
what
Gate sep-check in prettier CI check to SEP changes only.
why
Current prettier sep-check runs on PRs with CAP changes which is unnecessary. Since sep-check is meant for SEPs only its better to gate it.