Skip to content

oxc-project/oxfmt-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation



Oxc logo


OXC Stars Website CI npm Discord chat

⚓ Run Oxfmt on your repo

This action checks formatting of your JS/TS codebase with Oxfmt. Pull requests will only have their changed files checked by default.

For monorepos, you can use the working-directory input to check only a specific subdirectory.

⚡ Quick Start

Here's a minimal example to get you started:

# .github/workflows/ci.yml
name: CI
on:
  pull_request:
    branches:
      - main
    types: [opened, synchronize]
  push:
    branches:
      - main

jobs:
  format:
    name: Format (Oxfmt)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: oxc-project/oxfmt-action@v0.1.0

Example

Here's a more complete example with all available options:

name: Format
on: [push, pull_request]

jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: oxc-project/oxfmt-action@latest
        with:
          # Path to an Oxfmt configuration file.
          config: .oxfmtrc.json

          # Path to an ignore file. If not specified, .gitignore and
          # .prettierignore in the current directory are used.
          ignore-path: .prettierignore

          # By default, oxfmt-action will only check changed files when run on
          # pull requests. To disable this behavior, set this to true.
          # Note that this setting has no affect on any other kind of trigger.
          all-files: false

          # Explicitly specify the base branch that PRs will be compared against.
          # By default the branch the PR is attempting to merge into will be used.
          # Has no affect on any other kind of trigger.
          base-branch: main

          # Use a specific version of Oxfmt. You can also specify a SemVer
          # pattern. This gets forwarded to npx. By default, 'latest' is used.
          # See: https://www.npmjs.com/package/oxfmt
          version: latest

          # Specify a working directory to run oxfmt in. Useful for monorepos
          # where you want to check only a specific subdirectory.
          working-directory: frontend

❤ Who's Sponsoring Oxc?

My sponsors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages