You can use --tab-width prettier CLI option .

on:
  pull_request:
  push:
    branches:
      - master
      - validation

jobs:
  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          # Make sure the actual branch is checked out when running on pull requests
          ref: ${{ github.head_ref }}

      - name: Prettify code
        uses: creyD/[email protected]
        with:
          # This part is also where you can pass other options, for example:
          prettier_options: --write **/*.{js,md} --tab-width 4

Please note that [email protected] is just executing prettier <prettier_options> command on the runner. So if you have more options to add you can specify it in the prettier_options(Should be separated by spaces)

Answer from user459872 on Stack Overflow
🌐
GitHub
github.com › prettier › prettier
GitHub - prettier/prettier: Prettier is an opinionated code formatter. · GitHub
Prettier is an opinionated code formatter. Contribute to prettier/prettier development by creating an account on GitHub.
Author   prettier
🌐
GitHub
github.com › prettier › prettier-vscode
GitHub - prettier/prettier-vscode: Visual Studio Code extension for Prettier · GitHub
Visual Studio Code extension for Prettier. Contribute to prettier/prettier-vscode development by creating an account on GitHub.
Author   prettier
🌐
Medium
mskelton.medium.com › auto-formatting-code-using-prettier-and-github-actions-ed458f58b7df
Auto Formatting Code Using Prettier and GitHub Actions | by Mark Skelton | Medium
February 18, 2022 - After a few Google searches, I came across GitHub Prettier Action which formats your code using Prettier and commits any changes files when finished.
🌐
Prettier
prettier.io
Prettier · Opinionated Code Formatter · Prettier
GitHub-Flavored Markdown · MDX v1 · GraphQL · GraphQL Schemas · Community Plugins · Apex · Elm (via elm-format) Java · PHP · Ruby · Rust · TOML · XML · And more... prettier-js prettier.el Apheleia · espresso-prettier · Prettier Prettier⁺ · JsPrettier ·
🌐
GitHub
github.com › prettier › prettier-vscode › releases
Releases · prettier/prettier-vscode
Visual Studio Code extension for Prettier. Contribute to prettier/prettier-vscode development by creating an account on GitHub.
Author   prettier
🌐
GitHub
github.com › prettier › prettier-emacs
GitHub - prettier/prettier-emacs: Minor mode to format code on file save
Minor mode to format code on file save. Contribute to prettier/prettier-emacs development by creating an account on GitHub.
Starred by 395 users
Forked by 53 users
Languages   Emacs Lisp 98.3% | JavaScript 1.7%
Find elsewhere
🌐
GitHub
github.com › prettier › prettier-cli
GitHub - prettier/prettier-cli: A faster CLI for Prettier.
A faster CLI for Prettier. Contribute to prettier/prettier-cli development by creating an account on GitHub.
Starred by 40 users
Forked by 10 users
Languages   JavaScript 50.9% | TypeScript 48.9%
🌐
GitHub
github.com › prettier › prettier-eslint
GitHub - prettier/prettier-eslint: Code `prettier` `eslint --fix` Formatted Code :sparkles: · GitHub
Code :arrow_right: `prettier` :arrow_right: `eslint --fix` :arrow_right: Formatted Code :sparkles: - GitHub - prettier/prettier-eslint: Code `prettier` `eslint --fix` Formatted Code :sparkles:
Author   prettier
🌐
Medium
medium.com › @cthach › prettier-eslint-vs-code-and-github-actions-deb893f099fd
Auto-formatting using Prettier, ESLint, VS Code and GitHub Actions 🪄 | by Chris Thach | Medium
September 22, 2024 - Running npm run format will automatically fix all Prettier ESlint errors in all files. In your project’s root directory, create a new file called .github/workflows/ci.yml with the following content:
🌐
npm
npmjs.com › package › prettier
prettier - npm
January 21, 2026 - [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) See CONTRIBUTING.md. none · npm i prettier · github.com/prettier/prettier · prettier.io · Fund this package · 78,568,413 ·
      » npm install prettier
    
Published   Jan 21, 2026
Version   3.8.1
Author   James Long
🌐
GitHub
github.com › zed-industries › zed › discussions › 13602
ESLint and Prettier Format on Save? · zed-industries/zed · Discussion #13602
Although it’s slightly slow, this setup successfully runs both Prettier and ESLint --fix on save for me!
Author   zed-industries
🌐
Simon Willison
til.simonwillison.net › github-actions › prettier-github-actions
Using Prettier to check JavaScript code style in GitHub Actions | Simon Willison’s TILs
The npx prettier --check 'datasette/static/*[!.min].js' line ensures that prettier is run in "check" mode (which fails the tests if a matching file does not conform to the formatting rules) - it checks any .js file in the datasette/static folder but excludes any .min.js minified files.
🌐
GitHub
github.com › prettier › prettier-browser-extension
GitHub - prettier/prettier-browser-extension: Prettier Browser Extension
Prettier Browser Extension. Contribute to prettier/prettier-browser-extension development by creating an account on GitHub.
Starred by 204 users
Forked by 17 users
Languages   JavaScript 93.5% | SCSS 6.0% | HTML 0.5%
🌐
GitHub
gist.github.com › gustavwennerblom › b17a6b8c12a6e10f88306ad3e42f26bd
Adding prettier to a CRA project · GitHub
Save gustavwennerblom/b17a6b8c12a6e10f88306ad3e42f26bd to your computer and use it in GitHub Desktop. ... Previously, I've had some problem to reliaby configure code formatting with Prettier in VSCode, in the context of a create-react-app proejct.
🌐
Reddit
reddit.com › r/neovim › neovim and prettier
r/neovim on Reddit: Neovim and prettier
August 10, 2025 -

Neovim and prettier is quite complicated story for me. Let's start that officially prettier recommends not to use prettier together with linter (https://prettier.io/docs/integrating-with-linters) and that makes everything more complicated (while eslint and prettier integration is quite OK, especially with eslint LSP). Now if want to use prettier separately official prettier page https://prettier.io/docs/vim offers either outdated options or the ones I don't want to use. null-ls was quite option until it was discontinued. Lastly I was using prettier via conform.nvim together with prettierd.

However I felt that there should be better way. Now I don't have time to implement that properly, but that's a task I could give to AI (opencode + sonnet 4.5). Here is result: prettier LSP https://github.com/daliusd/prettier-lsp . It works as fast as prettierd and does not need any extra plugins. Most probably it can be improved, but it is quite fun what you can do in 2 hours if all you have is idea.

🌐
Akhilaariyachandra
akhilaariyachandra.com › home › blog › prettier in github actions
Prettier in GitHub Actions | Akhila Ariyachandra
September 12, 2023 - Go to your branch settings in GitHub under Settings > Branches. Edit the rule for the main branch by checking "Require status checks to pass before merging" and adding the "Prettier" check under "Status checks that are required.".
🌐
Prettier
prettier.io › docs › options
Options · Prettier
By default, Prettier will not change wrapping in markdown text since some services use a linebreak-sensitive renderer, e.g. GitHub comments and BitBucket. To have Prettier wrap prose to the print width, change this option to "always".
🌐
GitHub
github.com › alshedivat › al-folio › discussions › 2623
How to run prettier check ? · alshedivat/al-folio · Discussion #2623
Then, you can install it using npm install prettier inside the project directory, or install it globally on your computer using npm install -g prettier. To run prettier on your current directory use npx prettier .
Author   alshedivat
🌐
Prettier
prettier.io › docs › install
Install · Prettier
For example, you can do the following to have Prettier run before each commit: Install husky and lint-staged: npm · yarn · pnpm · bun · npm install --save-dev husky lint-staged npx husky init node --eval "fs.writeFileSync('.husky/pre-commit','npx lint-staged\n')" yarn add --dev husky lint-staged npx husky init node --eval "fs.writeFileSync('.husky/pre-commit','yarn lint-staged\n')" note · If you use Yarn 2, see https://typicode.github.io/husky/#/?id=yarn-2 ·