conftest-action icon indicating copy to clipboard operation
conftest-action copied to clipboard

Where do I place the rego policy file

Open Asiya-Yunusa opened this issue 2 years ago • 0 comments

Hello, I placed my rego file in the repository where my yaml files are but the test step in GH actions says it can't find the file. Where do I place the rego file please?

this is the step output /usr/bin/docker run --name instrumentaconftestlatest_2b2a1c --label 4cd[9](https://github.com/cd-compliance/conftest-compliance-cd/runs/7681476066?check_suite_focus=true#step:5:10)8f --workdir /github/workspace --rm -e INPUT_FILES -e INPUT_POLICY -e INPUT_NAMESPACE -e INPUT_COMBINE -e INPUT_OUTPUT -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true --entrypoint "sh" -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/conftest-compliance-cd/conftest-compliance-cd":"/github/workspace" instrumenta/conftest:latest "-c" "conftest test -o \"stdout\" -p \"sample-policy.rego\" --namespace \"main\" --combine=\"false\" sample-manifest.yaml" ? - sample-manifest.yaml - no policies found

this is where my policy and yaml file is located

image

This is my workflow

jobs:

conftest: # The type of runner that the job will run on runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
  # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  - uses: actions/checkout@v3
  
  - uses: actions/checkout@master
  - name: test
    uses: instrumenta/conftest-action@master
    with:
      files: sample-manifest.yaml
      policy: sample-policy.rego

Will really appreciate some help

Thank you.

Asiya-Yunusa avatar Aug 07 '22 20:08 Asiya-Yunusa