Skip to content

Commit 6f86b54

Browse files
committed
Add PR creation step
[skip ci]
1 parent bc1aab5 commit 6f86b54

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/bump-controls.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,20 @@ jobs:
4343
Write-Output "Bumped version to $newVersion"
4444
echo "::set-output name=new_version::$newVersion"
4545
46-
- uses: EndBug/add-and-commit@v9
46+
- name: Get version for PR message
47+
id: get_version
48+
shell: pwsh
49+
run: |
50+
$xml = [xml](Get-Content $env:PROPS_PATH)
51+
$microVersion = [int]$xml.Project.PropertyGroup.MicroVersion
52+
$minorVersion = [int]$xml.Project.PropertyGroup.MinorVersion
53+
$majorVersion = [int]$xml.Project.PropertyGroup.MajorVersion
54+
$fullVersion = "$majorVersion.$minorVersion.$microVersion"
55+
Write-Output "Found publish version, $fullVersion"
56+
echo "::set-output name=full_version::$fullVersion"
57+
58+
- name: Add and commit changes
59+
uses: EndBug/add-and-commit@v9
4760
with:
4861
# The arguments for the `git add` command
4962
# Default: '.'
@@ -66,11 +79,11 @@ jobs:
6679

6780
# The message for the commit.
6881
# Default: 'Commit from GitHub Actions (name of the workflow)'
69-
message: 'Bump Files UI controls micro version to ${{ steps.bump_version.outputs.new_version }}'
82+
message: 'Bump Files UI controls version to ${{ steps.get_version.outputs.full_version }}'
7083

7184
# If this input is set, the action will push the commit to a new branch with this name.
7285
# Default: ''
73-
new_branch: 'files/ui-controls/micro${{ steps.bump_version.outputs.new_version }}'
86+
new_branch: 'files/ui-controls/${{ steps.get_version.outputs.full_version }}'
7487

7588
# The way the action should handle pathspec errors from the add and remove commands. Three options are available:
7689
# - ignore -> errors will be logged but the step won't fail
@@ -81,4 +94,9 @@ jobs:
8194

8295
# Whether to push the commit and, if any, its tags to the repo. It can also be used to set the git push arguments (see the paragraph below for more info)
8396
# Default: true
84-
push: true
97+
push: true
98+
99+
- name: Create Pull Request
100+
shell: pwsh
101+
run: |
102+
gh pr create --title "NuGet: Bumped Files UI controls version to `${{ steps.get_version.outputs.full_version }}`" --body "This PR bumps the Files UI controls micro version to `${{ steps.bump_version.outputs.new_version }}`, with publish version ${{ steps.get_version.outputs.full_version }}" --base main --head files/ui-controls/${{ steps.get_version.outputs.full_version }}

0 commit comments

Comments
 (0)