Skip to content

Gate the sep-check in prettier CI check to changes in ecosystem folder only#1905

Merged
anupsdf merged 4 commits intostellar:masterfrom
anupsdf:fix_prettier
Apr 9, 2026
Merged

Gate the sep-check in prettier CI check to changes in ecosystem folder only#1905
anupsdf merged 4 commits intostellar:masterfrom
anupsdf:fix_prettier

Conversation

@anupsdf
Copy link
Copy Markdown
Contributor

@anupsdf anupsdf commented Apr 9, 2026

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.

@anupsdf anupsdf changed the title Gate sep-check in prettier CI check to SEP changes only Gate the sep-check in prettier CI check to changes in ecosystem folder only Apr 9, 2026
@anupsdf
Copy link
Copy Markdown
Contributor Author

anupsdf commented Apr 9, 2026

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:
https://github.com/stellar/stellar-protocol/actions/runs/24204747873/job/70657526236?pr=1905

sep-check ran when there were SEP changes in ecosystem/*.md file:
https://github.com/stellar/stellar-protocol/actions/runs/24204957783/job/70658255294?pr=1905

@anupsdf anupsdf marked this pull request as ready for review April 9, 2026 17:56
Copilot AI review requested due to automatic review settings April 9, 2026 17:56
@anupsdf anupsdf enabled auto-merge (squash) April 9, 2026 17:57
Copy link
Copy Markdown
Contributor

@bboston7 bboston7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@anupsdf anupsdf merged commit 1433458 into stellar:master Apr 9, 2026
9 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/*.md changed between PR base/head SHAs.
  • Conditionally run Node setup + yarn sep-check only 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
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
fetch-depth: 0
fetch-depth: 2

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +18
- 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
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Since this PR is merged already, I will create a new PR for this recommendation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing here, #1906

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants