Skip Prettier Github actions workflow based on pull_request.paths to avoid spinning runner unnecessarily#1906
Conversation
|
Tested this with dummy changes to ecosystem/ and core/ folders. Prettier ran for change made to ecosystem/*.md file: Prettier workflow runner was skipped when change was made to CAP file. |
There was a problem hiding this comment.
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.pathsfilters to only trigger the workflow on SEP markdown and Yarn dependency changes. - Removed the in-workflow
git diffdetection step and conditional step execution, since the workflow now only runs when needed.
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'ecosystem/*.md' |
There was a problem hiding this comment.
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.
| - 'ecosystem/*.md' | |
| - 'ecosystem/*.md' | |
| - '.prettierrc' | |
| - '.prettierignore' |
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)