Skip to content

Skip Prettier Github actions workflow based on pull_request.paths to avoid spinning runner unnecessarily#1906

Merged
anupsdf merged 5 commits intostellar:masterfrom
anupsdf:tighten-prettier
Apr 9, 2026
Merged

Skip Prettier Github actions workflow based on pull_request.paths to avoid spinning runner unnecessarily#1906
anupsdf merged 5 commits intostellar:masterfrom
anupsdf:tighten-prettier

Conversation

@anupsdf
Copy link
Copy Markdown
Contributor

@anupsdf anupsdf commented Apr 9, 2026

Use pull_request.paths filter (e.g., ecosystem/**) to avoid spinning up a runner at all.

This is a followup fix based on Copilot's recommendation here #1905 (comment)

@anupsdf
Copy link
Copy Markdown
Contributor Author

anupsdf commented Apr 9, 2026

Tested this with dummy changes to ecosystem/ and core/ folders.

Prettier ran for change made to ecosystem/*.md file:
https://github.com/stellar/stellar-protocol/actions/runs/24206673694/job/70664195366?pr=1906

Prettier workflow runner was skipped when change was made to CAP file.

@anupsdf anupsdf marked this pull request as ready for review April 9, 2026 18:32
Copilot AI review requested due to automatic review settings April 9, 2026 18:32
@anupsdf anupsdf enabled auto-merge (squash) April 9, 2026 18:32
@anupsdf anupsdf changed the title Skip Github actions workflow based on pull_request.paths for prettier CI job Skip Prettier Github actions workflow based on pull_request.paths to avoid spinning runner unnecessarily Apr 9, 2026
@anupsdf anupsdf merged commit 338f025 into stellar:master Apr 9, 2026
6 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

This PR updates the SEP Prettier GitHub Actions workflow to avoid scheduling a runner unless relevant files change, using pull_request.paths filtering.

Changes:

  • Added pull_request.paths filters to only trigger the workflow on SEP markdown and Yarn dependency changes.
  • Removed the in-workflow git diff detection step and conditional step execution, since the workflow now only runs when needed.

on:
pull_request:
paths:
- 'ecosystem/*.md'
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 workflow trigger is now gated by pull_request.paths, but changes to Prettier configuration files (e.g. .prettierrc and .prettierignore) won’t trigger this job. That means a PR can change formatting rules without CI validating yarn sep-check against the existing SEP markdown. Consider adding those config files to the paths list so config-only changes still run the check.

Suggested change
- 'ecosystem/*.md'
- 'ecosystem/*.md'
- '.prettierrc'
- '.prettierignore'

Copilot uses AI. Check for mistakes.
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