Skip to content

A GitHub action that syncs policies from git to an OPA Server

License

Notifications You must be signed in to change notification settings

OpsVerseIO/opa-policy-sync

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

Open Policy Agent (OPA) Policy Sync Action

GitHub Super-Linter CI Check dist/ CodeQL Coverage

A GitHub action that syncs REGO policies from Git to an OPA Server

Usage

Example workflow

This example updates policies from a git repository to an Open Policy Agent (OPA) Server.

name: Policy validation using OPA
on: [ push, pull_request ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@latest
      - name: Sync policy from git to Open Policy Agent (OPA)
        uses: OpsVerseIO/[email protected]
        with:
          opaServerUrl: "https://opa.example.com"
          opaServerAuthToken: ${{ secrets.OPA_SERVER_AUTH_TOKEN }}
          opaPoliciesPath: "./policies"
          recurseDirs: true
          skipTlsValidation: true # Skip TLS validation (Optional)

Inputs

Input Description
opaServerUrl Open Policy Agent (OPA) Server address (with protocol)
opaServerAuthToken Open Policy Agent (OPA) Auth token
opaPoliciesPath Path to REGO Policy directory
recurseDirs Whether to recursively traverse opaPoliciesPath (default = true)
skipTlsValidation Skip TLS validation. Get the data from OPA by ignoring the certificate (default = false)

About

A GitHub action that syncs policies from git to an OPA Server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •