Trying to run terraform-compliance GitHub action and getting an exception being thrown. Simple Azure PoC with a simple Terraform config and just trying to use the tests that are in user-friendly-features.
To Reproduce
GitHub Action yaml. Passing in the plan file via upload/download archive.
jobs:
scan:
# 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:
- name: Download Plan File
uses: actions/download-artifact@v3
with:
name: ${{inputs.plan_to_scan}}
- name: Show files
run: |
pwd
ls -l
- name: terraform-compliance
uses: terraform-compliance/github_action@main
with:
plan: plan.out.json
features: git:https://github.com/terraform-compliance/user-friendly-features.git
Features : /home/runner/work/tf-sonarcube-community-edition/tf-sonarcube-community-edition/git:https:/github.com/terraform-compliance/user-friendly-features.git/
Plan File : /home/runner/work/tf-sonarcube-community-edition/tf-sonarcube-community-edition/plan.out.json
Running in non-interactive mode.
Running tests.
list index out of range
! ERROR: local variable 'result' referenced before assignment
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.8/site-packages/radish/errororacle.py", line 72, in catch_unhandled_exception
handle_exception(exc_value)
File "/home/runner/.local/lib/python3.8/site-packages/terraform_compliance/extensions/override_radish_hookerrors.py", line 67, in handle_exception
write_failure(Failure(exception))
File "/home/runner/.local/lib/python3.8/site-packages/radish/utils.py", line 39, in init
traceback_info = traceback.extract_tb(sys.exc_info()[2])[-1]
IndexError: list index out of range
Original exception was:
Traceback (most recent call last):
File "/usr/local/bin/terraform-compliance", line 8, in
sys.exit(cli())
File "/home/runner/.local/lib/python3.8/site-packages/terraform_compliance/main.py", line 150, in cli
return result
UnboundLocalError: local variable 'result' referenced before assignment
Error: Process completed with exit code 1.
Description
Trying to run terraform-compliance GitHub action and getting an exception being thrown. Simple Azure PoC with a simple Terraform config and just trying to use the tests that are in user-friendly-features.
To Reproduce
GitHub Action yaml. Passing in the plan file via upload/download archive.
Feature File:
Only using user-friendly-features git repo
Plan File:
Sample Terraform Code:
Used
terraform-compliance
Parameters:only -p/-f
Running via Docker:
GitHub Actions
Error Output:
terraform-compliance v1.3.31 initiated
Error in sys.excepthook: Using remote git repository: git:https://github.com/terraform-compliance/user-friendly-features.git
list index out of range ! ERROR: local variable 'result' referenced before assignment Traceback (most recent call last): File "/home/runner/.local/lib/python3.8/site-packages/radish/errororacle.py", line 72, in catch_unhandled_exception handle_exception(exc_value) File "/home/runner/.local/lib/python3.8/site-packages/terraform_compliance/extensions/override_radish_hookerrors.py", line 67, in handle_exception write_failure(Failure(exception)) File "/home/runner/.local/lib/python3.8/site-packages/radish/utils.py", line 39, in init traceback_info = traceback.extract_tb(sys.exc_info()[2])[-1] IndexError: list index out of range
Original exception was: Traceback (most recent call last): File "/usr/local/bin/terraform-compliance", line 8, in
sys.exit(cli())
File "/home/runner/.local/lib/python3.8/site-packages/terraform_compliance/main.py", line 150, in cli
return result
UnboundLocalError: local variable 'result' referenced before assignment
Error: Process completed with exit code 1.
Expected Behavior:
No exception? :)
Tested Versions:
1.3.31
1.1.7
3.8