Skip to content

Commit

Permalink
Add outputs as per docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stv-io committed Jan 19, 2024
1 parent b774815 commit a49054c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ author: Stephen Attard

description: Setup tfswitch to install a specific version of terraform

outputs:
terraform_version:
description: "The installed version of terraform"
value: ${{ steps.tfswitch-install.outputs.terraform_version }}

runs:
using: composite
steps:
Expand All @@ -15,6 +20,7 @@ runs:
exit 1
- name: Install tfswitch
shell: bash
id: tfswitch-install
run: |
echo "Downloading install script .."
curl -sLo install.sh https://raw.githubusercontent.com/warrensbox/terraform-switcher/release/install.sh
Expand All @@ -33,11 +39,10 @@ runs:
echo $HOME/.bin >> $GITHUB_PATH
echo "Exporting terraform version to GITHUB_OUTPUT as terraform_version.."
echo "terraform_version=$(terraform --version -json | jq -r .terraform_version)" >> "$GITHUB_OUTPUT"
echo "Debug - dump github ouput"
echo $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
echo "Unlinking default version of terraform .."
unlink /usr/local/bin/terraform
if [ -e "/usr/local/bin/terraform" ]; then
echo "Unlinking default version of terraform .."
unlink /usr/local/bin/terraform
fi
echo "Done!"
branding:
Expand Down

0 comments on commit a49054c

Please sign in to comment.