diff --git a/.github/workflows/update-terraform-provider.yaml b/.github/workflows/update-terraform-provider.yaml index f35b977..06bb80c 100755 --- a/.github/workflows/update-terraform-provider.yaml +++ b/.github/workflows/update-terraform-provider.yaml @@ -19,11 +19,7 @@ jobs: - name: Check for New Terraform Provider Release id: check_release - run: | - latest_release=$(gh release list -R scaleway/terraform-provider-scaleway --limit 1) - latest_version=$(echo $latest_release | awk '{print $1}' | sed 's/^v//') - echo "Latest version: $latest_version" - echo "new_version=$latest_version" >> $GITHUB_ENV + run: ./scripts/check_version.sh - name: Read Current Terraform Provider Version from Makefile id: current_version diff --git a/config/tools/comparator/main.go b/config/tools/comparator/main.go index 4048829..d9e57b6 100644 --- a/config/tools/comparator/main.go +++ b/config/tools/comparator/main.go @@ -4,11 +4,12 @@ import ( _ "embed" "encoding/json" "fmt" - "golang.org/x/text/cases" - "golang.org/x/text/language" "os" "strings" + "golang.org/x/text/cases" + "golang.org/x/text/language" + "github.com/crossplane/upjet/pkg/registry" "github.com/pkg/errors" "github.com/scaleway/provider-scaleway/config/tools" diff --git a/config/tools/generator/main.go b/config/tools/generator/main.go index 7c56e48..4112e2a 100644 --- a/config/tools/generator/main.go +++ b/config/tools/generator/main.go @@ -75,7 +75,7 @@ func createNewConfigFile(filePath string, resourceConfig tools.ResourceConfig) e return fmt.Errorf("invalid file path: %s", cleanFilePath) } - err = os.WriteFile(filePath, formattedCode, 0644) + err = os.WriteFile(filePath, formattedCode, 0600) if err != nil { return err } diff --git a/scripts/check-version.sh b/scripts/check-version.sh new file mode 100755 index 0000000..7776254 --- /dev/null +++ b/scripts/check-version.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Check for the latest Terraform Provider release +latest_release=$(gh release list -R scaleway/terraform-provider-scaleway --limit 1) +latest_version=$(echo $latest_release | awk '{print $1}' | sed 's/^v//') +echo "Latest version: $latest_version" +echo "new_version=$latest_version" >> $GITHUB_ENV