Skip to content

Commit

Permalink
extract check tf version to a script
Browse files Browse the repository at this point in the history
  • Loading branch information
yfodil committed Aug 7, 2024
1 parent 9c4225e commit f72314e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/update-terraform-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions config/tools/comparator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion config/tools/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
7 changes: 7 additions & 0 deletions scripts/check-version.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f72314e

Please sign in to comment.