https://github.com/styrainc/setup-regal
Run Regal, the OPA Rego Linter, as a GitHub Action
https://github.com/styrainc/setup-regal
Last synced: 4 months ago
JSON representation
Run Regal, the OPA Rego Linter, as a GitHub Action
- Host: GitHub
- URL: https://github.com/styrainc/setup-regal
- Owner: StyraInc
- License: apache-2.0
- Created: 2023-07-20T09:02:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T09:07:35.000Z (almost 2 years ago)
- Last Synced: 2024-12-24T00:13:25.068Z (about 1 year ago)
- Language: TypeScript
- Size: 205 KB
- Stars: 12
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Setup Regal
GitHub action to configure [Regal](https://github.com/StyraInc/regal), the linter for Rego.
## Basic Usage
The following example shows how to use the action to install the latest version of Regal and lint some files
in `policy`:
```yml
name: Run Regal Lint Check
on: [push]
jobs:
lint-rego:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Regal
uses: StyraInc/setup-regal@v1
with:
version: latest
- name: Lint
run: regal lint --format github ./policy
```
## Choose Regal Version
### Using Latest
Using the latest version of Regal allows you to keep up-to-date with the latest Rules and best practices. However,
it might mean that policies that once passed, will need to be updated to pass with the latest version of Regal's rules.
> [!NOTE]
> You can always disable rules using [Regal config](https://docs.styra.com/regal/#configuration).
```yml
steps:
- name: Setup Regal
uses: StyraInc/setup-regal@v1
with:
version: latest
```
It's also possible to use a pinned version of Regal. This is recommended for pipelines that deploy to production
environments.
```yml
steps:
- name: Setup Regal
uses: StyraInc/setup-regal@v1
with:
version: x.y.z
```
You can also use a SemVer or [SemVer range](https://www.npmjs.com/package/semver#ranges).
```yml
steps:
- name: Setup Regal
uses: StyraInc/setup-regal@v1
with:
version: 0.10
```
```yml
steps:
- name: Setup Regal
uses: StyraInc/setup-regal@v1
with:
version: <0.10
```
## Inputs
The action supports the following inputs:
- `version`: Optional, defaults to `latest`. [SemVer ranges](https://www.npmjs.com/package/semver#ranges) are supported too.
- `github-token`: Optional, defaults to `${{ github.token }}`.
## Credits
This repo is based on the [Setup OPA Action](https://github.com/open-policy-agent/setup-opa).
## Community
For questions, discussions and announcements related to Styra products, services and open source projects, please join
the Styra community on [Slack](https://communityinviter.com/apps/styracommunity/signup)!