Skip to content

Commit 69107a5

Browse files
committed
Work CI-CD
- Improve publish step to skip commit of update README files, if there are no changes. - Remove extra bracket in auth computing for git authentication. ***NO_CI***
1 parent aafb30f commit 69107a5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

azure-pipelines.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,19 @@ steps:
215215
git config user.email '[email protected]'
216216
git config user.name 'nfbot'
217217
218+
# check if anything was changed
219+
$repoStatus = "$(git status --short --porcelain)"
220+
221+
if ($repoStatus -ne "")
222+
{
223+
Write-Host "There are changes in README files, changes will be pushed to GitHub"
224+
}
225+
else
226+
{
227+
Write-Host "Repository is clean, no changes to push to GitHub"
228+
exit 0
229+
}
230+
218231
git add README.md
219232
git add devices/README.md
220233
git commit -m "Update device lists" -m"***NO_CI***"
@@ -223,7 +236,7 @@ steps:
223236
224237
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
225238
# 'encoded token' is the Base64 of the string "nfbot:personal-token"
226-
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)"))))"
239+
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)")))"
227240
git -c http.extraheader="AUTHORIZATION: $auth" push origin "HEAD:$(Build.SourceBranchName)"
228241
229242
# step from template @ nf-tools repo

0 commit comments

Comments
 (0)