Skip to content

Commit

Permalink
v1.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
benyboy84 committed Apr 16, 2024
1 parent 975becd commit 4ca9ed1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/create_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,18 @@ jobs:
else
echo "ERROR | Variable is not an array."
exit 1
fi
fi
if ! [[ "${variable_value}" =~ "${{ github.event.inputs.module_name }}" ]]; then
echo "ERROR | Module's name is already in use.
exit 1
fi
echo "INFO | Adding new module's name into the array."
variable_value="${variable_value::-1}, \"${{ github.event.inputs.module_name }}\"]"
echo "${variable_value}"
echo "INFO | Converting \\\" into \\\\\"."
variable_value=${variable_value//\"/\\\"}
echo "${variable_value}"
echo "INFO | Building JSON payload."
json_string='{"data":{"id":"'"${{ steps.get_variable.outputs.variable_id }}"'","attributes":{"value":"'"${variable_value}"'"},"type":"vars"}}'
json_payload=$(echo "${json_string}" | jq)
echo "${json_payload}"
echo "INFO | Running API call to update variable."
{
run=$(curl -sS --request PATCH --url "${tfc_api_url}/vars/${{ steps.get_variable.outputs.variable_id }}" \
Expand Down

0 comments on commit 4ca9ed1

Please sign in to comment.