diff --git a/auth/action.yaml b/auth/action.yaml index af05dc6..1aa4eb4 100644 --- a/auth/action.yaml +++ b/auth/action.yaml @@ -22,7 +22,11 @@ runs: id: create shell: bash run: | - CREDENTIAL_FILE="$HOME/${{ inputs.terraform-cli-config-file }}" + CREDENTIAL_FILE="${{ inputs.terraform-cli-config-file }}" + # if CREDENTIAL_FILE does not start with $HOME, prepend it + if [[ ! "$CREDENTIAL_FILE" =~ ^\$HOME ]]; then + CREDENTIAL_FILE="$HOME/$CREDENTIAL_FILE" + fi if [[ -f "$CREDENTIAL_FILE" ]]; then echo "file-created=false" >> $GITHUB_OUTPUT echo "Terraform credentials already present, skipping."