Skip to content

Commit 4735408

Browse files
committed
Fix ThirdPartyNotices.txt update
1 parent 2ef913a commit 4735408

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

azure-pipelines.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ trigger:
66
include:
77
- 'main'
88
- 'release/*'
9-
- 'spec-main'
10-
- 'spec-release/*'
119
pr: none
1210

1311
steps:
12+
- checkout: self
13+
persistCredentials: true
1414
- task: ComponentGovernanceComponentDetection@0
1515
- task: notice@0
1616
displayName: 'NOTICE File Generator'
@@ -24,18 +24,19 @@ steps:
2424
echo "3rd-party notices unchanged."
2525
else
2626
echo "3rd-party notices changed."
27+
MESSAGE="Auto-update ThirdPartyNotices.txt"
28+
if [ "$(git log -1 --pretty=%B | head -n 1)" = "$MESSAGE" ]
29+
then
30+
echo "Triggered by own commit, not committing."
31+
exit 0
32+
fi
2733
cp "$PIPELINE_WORKSPACE/NOTICE.txt/NOTICE.txt" ThirdPartyNotices.txt
2834
git status
2935
git add ThirdPartyNotices.txt
3036
git config --global user.email "[email protected]"
3137
git config --global user.name "Christof Marti"
32-
git commit -m "Auto-update ThirdPartyNotices.txt"
33-
if [ "$(git log -1 --pretty=%B | head -n 1)" != "$(git log HEAD~2..HEAD~1 --pretty=%B | head -n 1)" ]
34-
then
35-
GIT_ASKPASS=scripts/gitAskPass.sh git push origin HEAD:$(Build.SourceBranch)
36-
else
37-
echo "Triggered by own commit, not pushing."
38-
fi
38+
git commit -m "$MESSAGE"
39+
git push origin HEAD:$(Build.SourceBranch)
3940
fi
4041
env:
4142
GIT_TOKEN: $(GIT_TOKEN)

0 commit comments

Comments
 (0)