Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressed the problem described in #3 #4

Merged
merged 2 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
version:
description: "Speficic terraform-compliance version to be used."
required: false
installed_path:
description: "In case you are running a custom runner, this is the path where terraform-compliance executable is installed."
required: false

outputs:
result:
Expand All @@ -33,7 +36,8 @@ outputs:
runs:
using: "composite"
steps:
- run: ${{ github.action_path }}/install.sh "${{ inputs.version }}" "${{ inputs.install_terraform }}" "${{ inputs.terraform_version }}"
- id: install
run: ${{ github.action_path }}/install.sh "${{ inputs.version }}" "${{ inputs.installed_path }}"
shell: bash
- id: run
run: ${{ github.action_path }}/run.sh "${{ inputs.plan }}" "${{ inputs.features }}" "${{ inputs.quit-early }}" "${{ inputs.no-failure}}" "${{ inputs.silent }}" "${{ inputs.identity }}" "${{ inputs.execute }}"
Expand Down
8 changes: 7 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ if [[ -n $1 ]]; then
v=$1
fi

INSTALLED_PATH="/home/runner/.local/bin/terraform-compliance"
if [[ -n $2 ]]; then
INSTALLED_PATH=$2
fi

# Required for installing terraform-compliance...
echo "Installing required packages for terraform-compliance"
sudo apt-get install -y -qq python3-setuptools python3-wheel > /dev/null
Expand All @@ -15,6 +20,7 @@ sudo apt-get install -y -qq python3-setuptools python3-wheel > /dev/null
echo "Installing terraform-compliance$VERSION version $v"
pip3 install -q wheel terraform-compliance$VERSION


if [ ! -f /usr/local/bin/terraform-compliance ]; then
sudo ln -s /home/runner/.local/bin/terraform-compliance /usr/local/bin
sudo ln -s "$INSTALLED_PATH" /usr/local/bin
fi
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

PARAMETERS="/home/runner/.local/bin/terraform-compliance"
PARAMETERS="/usr/local/bin/terraform-compliance"

if [[ -n $1 ]]; then
PLAN_FILE="$GITHUB_WORKSPACE/$1"
Expand Down