Important
Regal is now an official OPA project!
(More Info)
For those previously installing Regal from StyraInc/setup-regal
, please
update your scripts and documentation to refer to this Repo. We will be
migrating the Regal's documentation to openpolicyagent.org from the next
Regal release. Please
file an issue
for any problems you run into.
GitHub action to configure Regal, the Rego linter.
The following example shows how to use the action to install the latest version of Regal and lint some files
in policy
:
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: open-policy-agent/setup-regal@v1
with:
version: latest
- name: Lint
run: regal lint --format github ./policy
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.
steps:
- name: Setup Regal
uses: open-policy-agent/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.
steps:
- name: Setup Regal
uses: open-policy-agent/setup-regal@v1
with:
version: x.y.z
You can also use a SemVer or SemVer range.
steps:
- name: Setup Regal
uses: open-policy-agent/setup-regal@v1
with:
version: 0.10
steps:
- name: Setup Regal
uses: open-policy-agent/setup-regal@v1
with:
version: <0.10
The action supports the following inputs:
version
: Optional, defaults tolatest
. SemVer ranges are supported too.github-token
: Optional, defaults to${{ github.token }}
.
This repo is based on the Setup OPA Action.