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

Fix authorization bearer for existing terraform version #481

Merged
merged 3 commits into from
Aug 11, 2022
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
3 changes: 3 additions & 0 deletions terraform-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ All notable changes to the orb will be documented in this file.
Orbs are immutable, some orb versions with no significant changes are
not listed

## ovotech/[email protected]
- Added authentication to the API call for `/versions`

## ovotech/[email protected]
- Added target parameter for plan step

Expand Down
2 changes: 1 addition & 1 deletion terraform-v2/orb_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ovotech/[email protected].16
ovotech/[email protected].17
2 changes: 1 addition & 1 deletion terraform-v2/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if [[ "$REGISTRY_URL" == "" ]]; then
exit 2
fi

EXISTING_VERSION=$(curl "${REGISTRY_URL}${MODULE_NAME}/versions" | jq -c '.modules[0].versions[] | select(.version == '\"$VERSION\"')')
EXISTING_VERSION=$(curl -H "Authorization: Bearer $TF_REGISTRY_TOKEN" "${REGISTRY_URL}${MODULE_NAME}/versions" | jq -c '.modules[0].versions[] | select(.version == '\"$VERSION\"')')

if [[ ! -z "$EXISTING_VERSION" ]]; then
echo "Version $VERSION already exists"
Expand Down
4 changes: 4 additions & 0 deletions terraform/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to the orb will be documented in this file.
Orbs are immutable, some orb versions with no significant changes are
not listed

## ovotech/[email protected]
## Added
- Added authentication to the API call for `/versions`

## ovotech/[email protected]
## Added
- Added target parameter for plan step
Expand Down
2 changes: 1 addition & 1 deletion terraform/orb_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ovotech/[email protected].15
ovotech/[email protected].16
2 changes: 1 addition & 1 deletion terraform/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if [[ "$REGISTRY_URL" == "" ]]; then
fi


EXISTING_VERSION=$(curl "${REGISTRY_URL}${MODULE_NAME}/versions" | jq -c '.modules[0].versions[] | select(.version == '\"$VERSION\"')')
EXISTING_VERSION=$(curl -H "Authorization: Bearer $TF_REGISTRY_TOKEN" "${REGISTRY_URL}${MODULE_NAME}/versions" | jq -c '.modules[0].versions[] | select(.version == '\"$VERSION\"')')

if [[ ! -z "$EXISTING_VERSION" ]]; then
echo "Version $VERSION already exists"
Expand Down