Skip to content

SCALRCORE-31241: Policy example for workspace.environment_type #234

SCALRCORE-31241: Policy example for workspace.environment_type

SCALRCORE-31241: Policy example for workspace.environment_type #234

Workflow file for this run

name: OPA
on: [push, pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup OPA
uses: open-policy-agent/setup-opa@v2
with:
version: latest
- name: Run OPA Tests
run: |
dirs=$(find . -type f -name '*.rego' -exec dirname {} \; | sort -u)
echo "Directories to be tested:"
for dir in $dirs; do
echo "$dir"
done
for dir in $dirs; do
echo "Running tests in $dir"
if ! opa test $dir/ -v --format pretty; then
echo "Tests failed in $dir"
exit 1
fi
done