Skip to content

Commit

Permalink
.github: Update workflows to use actions variables and remove private…
Browse files Browse the repository at this point in the history
  • Loading branch information
bflad authored Nov 29, 2023
1 parent 30fb52f commit b9f59fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
permissions:
contents: read

env:
GOPRIVATE: github.com/hashicorp/terraform-plugin-codegen-spec

jobs:
golangci-lint:
runs-on: ubuntu-latest
Expand All @@ -23,7 +20,6 @@ jobs:
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: 'go.mod'
- run: git config --global url.https://${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/
- run: go mod download
- uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0

Expand All @@ -34,7 +30,6 @@ jobs:
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: 'go.mod'
- run: git config --global url.https://${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/
- run: go mod download
- run: go test -coverprofile=coverage.out ./...
- run: go tool cover -html=coverage.out -o coverage.html
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]

jobs:
changelog-version:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -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
Expand All @@ -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 ]
Expand Down

0 comments on commit b9f59fe

Please sign in to comment.