File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,29 @@ extends:
106
106
targetPath : ' $(Pipeline.Workspace)/tgz'
107
107
steps :
108
108
- checkout : none
109
+
110
+ - task : NodeTool@0
111
+ inputs :
112
+ versionSpec : 20.x
113
+ displayName : ' Install Node'
114
+
115
+ - task : CmdLine@2
116
+ displayName : Get commit hash
117
+ inputs :
118
+ script : |
119
+ # Read package.json and get gitHead
120
+ pushd $(Pipeline.Workspace)/tgz
121
+ ls -lhR
122
+ tar -zxvf typescript-*.tgz
123
+ cd package
124
+ GIT_COMMIT_HASH=$(node -e "console.log(JSON.parse(require('fs').readFileSync('package.json', 'utf-8')).gitHead)")
125
+ if [ -z "$GIT_COMMIT_HASH" ]; then
126
+ echo "Failed to get git commit hash from package.json"
127
+ exit 1
128
+ fi
129
+ echo "##vso[task.setvariable variable=GIT_COMMIT_HASH]$GIT_COMMIT_HASH"
130
+ echo "Git commit hash: $GIT_COMMIT_HASH"
131
+
109
132
- task : GitHubRelease@1
110
133
displayName : GitHub release (create)
111
134
inputs :
@@ -115,6 +138,7 @@ extends:
115
138
tagSource : userSpecifiedTag
116
139
tag : $(TAG_NAME)
117
140
title : TypeScript $(RELEASE_TITLE_NAME)
141
+ target : $(GIT_COMMIT_HASH)
118
142
releaseNotesSource : inline
119
143
releaseNotesInline : |
120
144
<!---
You can’t perform that action at this time.
0 commit comments