GitHub action to configure Regal, the linter for Rego.
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: StyraInc/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: 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.
steps:
- name: Setup Regal
uses: StyraInc/setup-regal@v1
with:
version: x.y.z
You can also use a SemVer or SemVer range.
steps:
- name: Setup Regal
uses: StyraInc/setup-regal@v1
with:
version: 0.10
steps:
- name: Setup Regal
uses: StyraInc/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.
For questions, discussions and announcements related to Styra products, services and open source projects, please join the Styra community on Slack!