https://github.com/jbajic/buildifier
GitHub action for running Bazel's format tool buildifier.
https://github.com/jbajic/buildifier
action bazel bazel-build buildifier buildtool formatter github-actions
Last synced: 4 months ago
JSON representation
GitHub action for running Bazel's format tool buildifier.
- Host: GitHub
- URL: https://github.com/jbajic/buildifier
- Owner: jbajic
- License: apache-2.0
- Created: 2022-11-04T19:04:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-17T20:20:19.000Z (over 3 years ago)
- Last Synced: 2025-01-13T14:27:45.650Z (over 1 year ago)
- Topics: action, bazel, bazel-build, buildifier, buildtool, formatter, github-actions
- Language: Starlark
- Homepage:
- Size: 27.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# buildifier action

GitHub Action for running Bazel's build tool buildifier. Works on linux, macOS
and windows.
Buildifier automatically checks one of the Bazel's files:
- `BUILD`
- `WORKSPACE`
- `.bzl`
## Inputs
| Name | Description | Required | Default |
| --- | --- | --- | --- |
| version | The version of the used `buildifier` | `false`| `6.0.0` |
| path | The path on which to run buildifier check. | `false`| `.` |
| mode | The mode in which to run buildifier [check|diff] | `false` | `check` |
## Example Usage
To use `buildifier` action you can follow presented examples to see how it works:
### Check every file
```yml
name: Bazel files check
on: [push]
jobs:
formatting-check:
name: Run buildifier check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run buildifier
uses: jbajic/buildifier@v1
```
### Check files in `src` directory
```yml
name: Check bazel files
on: [push]
jobs:
formatting-check:
name: Run buildifier check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run buildifier
uses: jbajic/buildifier@v1
with:
path: src
```
### Check all Bazel files and print out the difference
```yml
name: Check bazel files
on: [push]
jobs:
formatting-check:
name: Run buildifier check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run buildifier
uses: jbajic/buildifier@v1
with:
path: src
mode: diff
```
To print out the diff two steps will be performed:
1. Run buildifier in `multi_diff` mode,
2. Run `git diff` and print out the changes.
## License
Apache-2.0