What I want to achieve? Store terraform output value (ip address) as env variable in git hub actions and use it during updating network security group. What I have done? Based on: Github Actions, how to share a calculated value between job steps?:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
- name: Extract gateway ip
run: |
terraform init
echo "IP_GAT=$(terraform output -json gatewayStaticIp | jq -r .)" >> $GITHUB_ENV
working-directory: ${{ env.my_dir }}
- name: Update security group
run: |
ip=${{ env.IP_GAT }}
az network nsg rule update -g myGroup --nsg-name myName -n myRuleName --source-address-prefix $ip
Apparently there is some problem with jq even it seems to be exactly like in example(https://www.terraform.io/docs/commands/output.html):
Error: write EPIPE
Any ideas? Thanks in advance