Skip to content

StyraInc/setup-regal

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Setup Regal

GitHub action to configure 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:

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.

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

Inputs

The action supports the following inputs:

  • version: Optional, defaults to latest. SemVer ranges are supported too.
  • github-token: Optional, defaults to ${{ github.token }}.

Credits

This repo is based on the Setup OPA Action.

Community

For questions, discussions and announcements related to Styra products, services and open source projects, please join the Styra community on Slack!