-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix encoding issue with commit message file
The commitMsg.txt file created by Powershell started with an unknown character that git could not consume. This error is not easy to detect with powershell but shows up in gitbash for windows when using the 'cat' command to inspect the commitMsg.txt file.
- Loading branch information
1 parent
e28b6be
commit 3f8fbc6
Showing
1 changed file
with
15 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,10 @@ jobs: | |
run: | ||
shell: powershell | ||
steps: | ||
- name: Current dir | ||
- name: Current dir and PS version | ||
run: | | ||
'CurrentDir: ' + (Get-Location) | ||
$PSVersionTable.PSVersion | ||
- name: Checkout source nvda-microsoft-ui-uiautomation | ||
uses: actions/checkout@v3 | ||
with: | ||
|
@@ -29,7 +30,8 @@ jobs: | |
New-Item -ItemType "directory" "build" | ||
Set-Location source | ||
./build.ps1 -SubmoduleDir "microsoft-ui-uiautomation" -OutDir "../build" | ||
- name: Checkout gen branch into separate folder | ||
tree ../build /f | ||
- name: Checkout main-out branch into separate folder | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: nvaccess/nvda-microsoft-ui-uiautomation | ||
|
@@ -38,21 +40,26 @@ jobs: | |
- name: Empty destination directory | ||
# empty the 'out' folder directory, but don't delete .git, or the top level directory. | ||
run: | | ||
Get-ChildItem gen -Exclude .git | Remove-Item | ||
Get-Location | ||
tree out /f | ||
Get-ChildItem out -Exclude .git | Remove-Item | ||
tree out /f | ||
- name: Copy files | ||
run: | | ||
Get-Location | ||
./source/copyFiles.ps1 -RepoRoot "source" -BuildDir "build" -DestDir "out" | ||
tree out /f | ||
- name: Commit and push | ||
run: | | ||
# this is a git '--pretty=format' string | ||
# %h is SHA, %n is newline, | ||
# %s is commit message subject, %b is commit message body | ||
$COMMIT_FORMAT="Generated from %h%n%nCommit message:%n%s%n%b" | ||
Write-Output $COMMIT_FORMAT | ||
$prettyArg = $("--pretty=format:"+$COMMIT_FORMAT) | ||
Write-Output $prettyArg | ||
Set-Location source | ||
git log -1 HEAD $prettyArg > ../commitMsg.txt | ||
$(git log -1 HEAD $prettyArg) | out-file -FilePath ../commitMsg.txt -Encoding ASCII | ||
Get-ChildItem ../ | ||
Get-Content ../commitMsg.txt | ||
Set-Location ../out | ||
$status = $(git status --porcelain) | ||
if($status) { | ||
|
@@ -62,7 +69,8 @@ jobs: | |
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add . | ||
git commit -F ../commitMsg.txt | ||
git status --short | ||
git commit --file="../commitMsg.txt" | ||
git push | ||
} else { | ||
Write-Output "No changes" | ||
|