mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2025-12-15 16:12:35 +00:00
.github: Update workflows to use actions variables (#378)
Reference: https://github.com/hashicorp/terraform-devex-repos/issues/17 Reference: https://github.com/hashicorp/terraform-devex-repos/issues/35
This commit is contained in:
parent
b4be958214
commit
1f997cc1ff
1 changed files with 10 additions and 14 deletions
24
.github/workflows/release.yml
vendored
24
.github/workflows/release.yml
vendored
|
|
@ -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:
|
||||
major-version:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -55,11 +51,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"
|
||||
|
||||
update-package-version:
|
||||
needs: changelog
|
||||
|
|
@ -84,11 +80,11 @@ jobs:
|
|||
run: npm version "${{ inputs.versionNumber }}" --git-tag-version false
|
||||
- name: Git push
|
||||
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 package version"
|
||||
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: [ update-package-version, major-version ]
|
||||
|
|
@ -107,13 +103,13 @@ 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 tag -f "${{ needs.major-version.outputs.version }}"
|
||||
git push "https://${{ env.CI_COMMIT_AUTHOR }}:${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" "${{ inputs.versionNumber }}"
|
||||
git push "https://${{ env.CI_COMMIT_AUTHOR }}:${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" -f "${{ needs.major-version.outputs.version }}"
|
||||
git push "https://${{ vars.TF_DEVEX_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" -f "${{ needs.major-version.outputs.version }}"
|
||||
|
||||
release:
|
||||
needs: [ changelog-version, release-tag ]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue