Skip to content

Commit

Permalink
use github cli to fetch last terraform provider release
Browse files Browse the repository at this point in the history
  • Loading branch information
yfodil committed Dec 12, 2023
1 parent 3ee96b6 commit 50f58cc
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/update-terraform-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Install jq
run: sudo apt-get install jq

- name: Check for New Terraform Provider Release
id: check_release
run: |
API_URL="https://api.github.com/repos/scaleway/terraform-provider-scaleway/releases/latest"
latest_release=$(curl -s $API_URL)
latest_version=$(echo $latest_release | jq -r '.tag_name' | sed 's/^v//')
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
Expand All @@ -48,4 +44,4 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update Terraform provider to ${{ env.new_version }}"
branch: ${{ github.head_ref }}
branch: ${{ github.head_ref }}

0 comments on commit 50f58cc

Please sign in to comment.