Skip to content

Commit e7501eb

Browse files
Update SHA (#1316)
- Update the action SHA to pick up changes from #1314 and #1315. - Bump the workflow SHA to the release SHA.
1 parent 811ab05 commit e7501eb

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.github/workflows/bump-version.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ jobs:
3939
$fileName = Join-Path "." "package.json"
4040
$json = (Get-Content $fileName | Out-String | ConvertFrom-Json)
4141
42+
$currentVersion = $json.version
43+
4244
if (-Not [string]::IsNullOrEmpty(${env:NEXT_VERSION})) {
4345
$version = [System.Version]::new(${env:NEXT_VERSION})
4446
} else {
45-
$version = [System.Version]::new($json.version)
47+
$version = [System.Version]::new($currentVersion)
4648
$version = [System.Version]::new($version.Major, $version.Minor, $version.Build + 1)
4749
}
4850
@@ -56,7 +58,14 @@ jobs:
5658
$json.packages.''.version = $updatedVersion
5759
$json | ConvertTo-Json -Depth 32 | Set-Content $fileName
5860
59-
"version=${updatedVersion}" >> $env:GITHUB_OUTPUT
61+
if (${env:GITHUB_EVENT_NAME} -eq "release") {
62+
$workflowPath = Join-Path "." ".github" "workflows" "update-dotnet-sdk.yml"
63+
$workflowContent = Get-Content $workflowPath -Raw
64+
$workflowContent = $workflowContent -Replace "(?m)^(\s+uses: martincostello\/update-dotnet-sdk\@)(.*)$", "`$`{1`}${env:GITHUB_SHA} # v${currentVersion}`r"
65+
Set-Content -Path $workflowPath -Value $workflowContent.TrimEnd()
66+
}
67+
68+
"version=${updatedVersion}" >> ${env:GITHUB_OUTPUT}
6069
6170
- name: Push changes to GitHub
6271
id: push-changes
@@ -92,9 +101,9 @@ jobs:
92101
git commit -m "Bump version`n`nBump version to ${env:NEXT_VERSION} for the next release."
93102
git push -u origin $branchName
94103
95-
"branch-name=${branchName}" >> $env:GITHUB_OUTPUT
96-
"updated-version=true" >> $env:GITHUB_OUTPUT
97-
"version=${env:NEXT_VERSION}" >> $env:GITHUB_OUTPUT
104+
"branch-name=${branchName}" >> ${env:GITHUB_OUTPUT}
105+
"updated-version=true" >> ${env:GITHUB_OUTPUT}
106+
"version=${env:NEXT_VERSION}" >> ${env:GITHUB_OUTPUT}
98107
99108
- name: Create pull request
100109
if: steps.push-changes.outputs.updated-version == 'true'

.github/workflows/update-dotnet-sdk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ jobs:
253253
# for the same release channel as the SDK specified in global.json.
254254
- name: Update .NET SDK
255255
id: update-dotnet-sdk
256-
uses: martincostello/update-dotnet-sdk@444b0c97f151b01c8d0646ffd0187c4787c17aeb # v3.8.0
256+
uses: martincostello/update-dotnet-sdk@811ab05ef143b396629d3cd808c6af78203b7171 # v3.8.1
257257
with:
258258
branch-name: ${{ inputs.branch-name }}
259259
channel: ${{ inputs.channel }}

0 commit comments

Comments
 (0)