Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
terminal

GitHub Action

Setup Biome

v2.0.1

Setup Biome

terminal

Setup Biome

Setup the Biome CLI in GitHub Actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup Biome

uses: biomejs/[email protected]

Learn more about this action in biomejs/setup-biome

Choose a version

Setup Biome CLI in GitHub Actions

GitHub release (latest SemVer) Test Integrate

Setup Biome is a GitHub action that provides a cross-platform interface for setting up the Biome CLI in GitHub Actions runners.

Inputs

The following inputs are supported.

- name: Setup Biome
  uses: biomejs/setup-biome@v2
  with:

    # The version of the Biome CLI to install.
    # This input is optional and by default the version will be automatically
    # detected from the project's dependencies. If no version is found in the
    # project's dependencies, the latest version of the Biome CLI will be installed.
    # Example values: "1.5.1", "latest"
    version: ""

    # The GitHub token to use to authenticate GitHub API requests.
    # This input is optional and defaults to the job's GitHub token.
    # Example value: ${{ secrets.GITHUB_TOKEN }}
    token: ${{ github.token }}

    # The directory in which the lockfile will be looked for when automatically
    # determining the version of the Biome CLI to install. Defaults to the current
    # working directory.
    working-dir: ""

Examples

Automatic version detection

To automatically determine the version of Biome to install based on the project's dependencies, you can simply omit the version input.

The action will search for the version of the @biomejs/biome dependency in the lockfiles of popular package managers such as npm, yarn, pnpm, and bun. It will then install that specific version of the Biome CLI.

Important

Bun users must configure Bun to output a yarn lockfile because this action cannot yet read bun's binary lockfile format. An easy way to do this is to add the following to your bunfig.toml file:

[install.lockfile]
print = "yarn"

If no version of the Biome CLI is found in the lockfiles, the action will install the latest version of the Biome CLI.

- name: Setup Biome CLI
  uses: biomejs/setup-biome@v2

- name: Run Biome
  run: biome ci .

Latest version

Setup the latest version of the Biome CLI.

- name: Setup Biome CLI
  uses: biomejs/setup-biome@v2
  with:
    version: latest

- name: Run Biome
  run: biome ci .

Specific version

Install version 1.5.1 of the Biome CLI.

- name: Setup Biome CLI
  uses: biomejs/setup-biome@v2
  with:
    version: 1.5.1

- name: Run Biome
  run: biome ci .

License

Copyright © 2023, Nicolas Hedger. Released under the MIT License.