-
Notifications
You must be signed in to change notification settings - Fork 50
60 lines (54 loc) · 2.19 KB
/
automation-version-bumper.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Run the Version Bumper
on:
push:
branches:
- main
paths:
- '.github/workflows/automation-version-bumper.yaml'
- 'config/resource-manager.hcl'
- 'submodules/msgraph-metadata'
- 'submodules/rest-api-specs'
- 'tools/version-bumper/**'
workflow_dispatch: # for manual invocations
jobs:
run-version-bumper:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: recursive
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: ./.go-version
- 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 }}