From b76812c0f2b35430caa58b47250ae09b6d6b8b50 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 29 Nov 2023 07:23:55 -0500 Subject: [PATCH] .github: Update workflows to use actions variables Reference: https://github.com/hashicorp/terraform-devex-repos/issues/17 Reference: https://github.com/hashicorp/terraform-devex-repos/issues/35 --- .github/workflows/ci-go.yml | 13 +------------ .github/workflows/release.yml | 16 ++++++---------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml index 881726dce..65c68db7a 100644 --- a/.github/workflows/ci-go.yml +++ b/.github/workflows/ci-go.yml @@ -28,18 +28,7 @@ jobs: strategy: matrix: go-version: [ '1.21', '1.20' ] - terraform-version: - - '0.12' - - '0.13' - - '0.14' - - '0.15' - - '1.0' - - '1.1' - - '1.2' - - '1.3' - - '1.4' - - '1.5' - - '1.6' + terraform-version: ${{ fromJSON(vars.TF_VERSIONS_PROTOCOL_V5) }} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 693553568..0fe1a9c01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,10 +11,6 @@ on: permissions: contents: read # Changelog commit operations use service account PAT -env: - CI_COMMIT_AUTHOR: hc-github-team-tf-provider-devex - CI_COMMIT_EMAIL: github-team-tf-provider-devex@hashicorp.com - jobs: changelog-version: runs-on: ubuntu-latest @@ -47,11 +43,11 @@ jobs: args: merge - name: Git push changelog run: | - git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" - git config --global user.email "${{ env.CI_COMMIT_EMAIL }}" + git config --global user.name "${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}" + git config --global user.email "${{ vars.TF_DEVEX_CI_COMMIT_EMAIL }}" git add . git commit -a -m "Update changelog" - git push "https://${{ env.CI_COMMIT_AUTHOR }}:${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" + git push "https://${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}:${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" release-tag: needs: changelog @@ -70,11 +66,11 @@ jobs: - name: Git push release tag run: | - git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" - git config --global user.email "${{ env.CI_COMMIT_EMAIL }}" + git config --global user.name "${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}" + git config --global user.email "${{ vars.TF_DEVEX_CI_COMMIT_EMAIL }}" git tag "${{ inputs.versionNumber }}" - git push "https://${{ env.CI_COMMIT_AUTHOR }}:${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" "${{ inputs.versionNumber }}" + git push "https://${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}:${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" "${{ inputs.versionNumber }}" goreleaser: needs: [ changelog-version, changelog, release-tag ]