Merge pull request #2807 from hashicorp/revert-2805-revert-2660-compu… #614
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run the Version Bumper | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/**' | |
- 'config/**' | |
- 'swagger' | |
- 'tools/version-bumper/**' | |
jobs: | |
run-version-bumper: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 | |
with: | |
go-version: '1.20.5' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 | |
with: | |
dotnet-version: 7.0.x | |
- name: build and run version-bumper | |
id: bump-versions | |
run: | | |
cd ./tools/version-bumper | |
make tools | |
make build | |
make run | |
- name: then commit the diff | |
id: commit-versions-config | |
run: | | |
git checkout -b config/regeneration-from-${{ github.sha }} | |
git config user.name "hc-github-team-tf-azure" | |
git config user.email "<>" | |
./scripts/conditionally-commit-codegen-changes.sh "config: regenerating based on the latest Swagger" | |
- name: then conditionally push the branch | |
id: push-branch | |
if: ${{ steps.commit-versions-config.outputs.has_changes_to_push == 'true' || steps.commit-imported-data.outputs.has_changes_to_push == 'true' }} | |
run: | | |
git push origin config/regeneration-from-${{ github.sha }} | |
- name: then conditionally open a pull request | |
id: open-pr | |
if: ${{ steps.commit-versions-config.outputs.has_changes_to_push == 'true' || steps.commit-imported-data.outputs.has_changes_to_push == 'true' }} | |
run: | | |
gh pr create --title "$PR_TITLE" --body "$PR_BODY" -H "$PR_SOURCE" -B "$PR_TARGET" | |
env: | |
PR_TITLE: "Config: regenerating based on ${{ github.sha }}" | |
PR_BODY: "Updating the Resource Manager configuration based on the commit ${{ github.sha }}" | |
PR_SOURCE: "config/regeneration-from-${{ github.sha }}" | |
PR_TARGET: "main" | |
GITHUB_TOKEN: ${{ secrets.SERVICE_ACCOUNT_PANDORA_TOKEN }} |