https://github.com/biomejs/setup-biome
Setup the Biome CLI in GitHub Actions
https://github.com/biomejs/setup-biome
biome biomejs formatter github-actions linter
Last synced: about 1 month ago
JSON representation
Setup the Biome CLI in GitHub Actions
- Host: GitHub
- URL: https://github.com/biomejs/setup-biome
- Owner: biomejs
- License: mit
- Created: 2023-09-19T17:21:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-19T22:26:45.000Z (over 1 year ago)
- Last Synced: 2024-05-20T06:15:15.019Z (over 1 year ago)
- Topics: biome, biomejs, formatter, github-actions, linter
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/setup-biome
- Size: 696 KB
- Stars: 41
- Watchers: 6
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Setup Biome CLI in GitHub Actions
[](https://github.com/marketplace/actions/setup-biome)
[](https://github.com/biomejs/setup-biome/actions/workflows/test.yaml)
[](https://github.com/biomejs/setup-biome/actions/workflows/integrate.yaml)**Setup Biome** is a GitHub action that provides a cross-platform interface
for setting up the [Biome CLI](https://biomejs.dev) in GitHub
Actions runners.## Inputs
The following inputs are supported.
```yaml
- 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: "2.2.2", "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 look for the version of the `@biomejs/biome` dependency in the lockfiles of popular package managers such as npm, yarn, pnpm, and bun. If the version cannot be found in the lockfiles, the action will attempt to retrieve the version from the `package.json` file, and as a last
resort, it will install the latest version of the Biome CLI.```yaml
- name: Setup Biome CLI
uses: biomejs/setup-biome@v2- name: Run Biome
run: biome ci
```> [!IMPORTANT]
> We recommend that you *pin* the version of `@biomejs/biome` in your project's dependencies. If you provide a semver range, and automatic version detection falls back to reading the `package.json file`, the highest version within the range will be used. See the [versioning documentation](https://biomejs.dev/internals/versioning/) for more information.### Latest version
Setup the latest version of the Biome CLI.
```yaml
- name: Setup Biome CLI
uses: biomejs/setup-biome@v2
with:
version: latest- name: Run Biome
run: biome ci
```### Specific version
Install version `2.2.2` of the Biome CLI.
```yaml
- name: Setup Biome CLI
uses: biomejs/setup-biome@v2
with:
version: 2.2.2- name: Run Biome
run: biome ci
```## License
Copyright © 2023, Nicolas Hedger. Released under the [MIT License](LICENSE.md).