Description
Prettier Action is a GitHub action that runs Prettier on your files inside a workflow, so code style is applied automatically to the repository. You add it to a workflow and set its inputs. Dry mode leaves files unchanged and fails the action if any file is not formatted, and the README recommends pairing it with --check in prettier_options. The no_commit option skips the commit step for workflows where another step commits later. You can pin a Prettier version, which defaults to the latest release, and set a working directory for projects in subfolders. The prettier_options input sets the Prettier command and defaults to formatting all JavaScript files, and prettier_plugins installs plugins such as the PHP plugin. Commit and push options, the commit message and its description, and the file pattern for git add are all configurable. The same_commit option updates the current commit instead of creating a new one, and it needs the checkout step to fetch full history. The README includes an example config and an issues section. The source is public on GitHub.…
Highlights
- Runs Prettier inside GitHub workflows
- Dry mode fails on unformatted files
- Configurable commit, push and message options
- Pin a Prettier version or add plugins
- Working directory for subfolder projects
Ratings & Reviews
No ratings yet
Be the first to rate Prettier Action.
People also visit
Add And Commit
Automatically commit changes made in your workflow run directly to your repo
Prettier Action FAQ
What does it do?
It runs Prettier on your repository inside a GitHub workflow and commits the changes, so formatting is applied without a manual step.
How do I check formatting without changing files?
Turn on dry mode. Files are not changed, and the action fails if any file is unformatted. The README recommends using --check in prettier_options.
Which Prettier version does it use?
The latest version by default. The prettier_version input lets you pin a specific one.
Can it format only some files?
Yes. prettier_options sets which files Prettier runs on, and file_pattern sets which files git add stages.
Is it open source?
Yes. The source is public on GitHub at creyD/prettier_action.
What are the best Prettier Action alternatives?
Popular alternatives to Prettier Action include Create Pull Request, Add And Commit and Slash Command Dispatch. See all Prettier Action alternatives












