creyd/Prettier Action

Automatically runs prettier on all your changes.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Maintainedlast commit Jun 9, 2025
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: creyd/prettier_action@8c18391fdc98ed0d884c6345f03975edac71b8f0 # v4.6

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
commit_messageCommit message, will be ignored if used with same_commitnoPrettified Code!
commit_descriptionExtended commit message, will be ignored if used with same_commitno""
same_commitUpdate the current commit instead of creating a new onenofalse
commit_optionsCommit optionsno
push_optionsGit push optionsno
file_patternFile pattern used for `git add`, can't be used with only_changed or only_changed_pr!no*
prettier_optionsOptions for the `prettier` commandno--write **/*.js
dryRunning the script in dry mode just shows whether there are files that should be prettified or notnofalse
no_commitCan be used to avoid committing the changes (can be combined with dry mode, useful when another workflow steps commits after this commit anyways)nofalse
prettier_versionSpecific version of prettier (by default just use the latest version)nolatest
working_directorySpecify a directory to cd into before installing prettier and running itno${{ github.action_path }}
only_changedOnly prettify files changed in the last commit, can't be used with file_pattern!nofalse
only_changed_prOnly prettify files changed in the current PR. If specified with only_changed, only_changed will take precedent. Can't be used with file_pattern!nofalse
prettier_pluginsInstall Prettier plugins, i.e. `@prettier/plugin-php @prettier/plugin-other`no""
github_tokenGitHub Token or PAT token used to authenticate against a repositoryno${{ github.token }}
clean_node_folderRemove the node_modules folder before committing changesnotrue
git_identityWhich identity is used for git name/email when committing changes. Needs to be one of "actions" or "author".noactions
allow_other_pluginsAllow other plugins to be installed. By default, we are checking if the plugins are actually prettier plugins.nofalse

no outputs