Skip to content

Commit 837e3a1

Browse files
authored
Fix releaser tag creation (#62522)
1 parent 968d5de commit 837e3a1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

azure-pipelines.release-publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,29 @@ extends:
106106
targetPath: '$(Pipeline.Workspace)/tgz'
107107
steps:
108108
- 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+
109132
- task: GitHubRelease@1
110133
displayName: GitHub release (create)
111134
inputs:
@@ -115,6 +138,7 @@ extends:
115138
tagSource: userSpecifiedTag
116139
tag: $(TAG_NAME)
117140
title: TypeScript $(RELEASE_TITLE_NAME)
141+
target: $(GIT_COMMIT_HASH)
118142
releaseNotesSource: inline
119143
releaseNotesInline: |
120144
<!---

0 commit comments

Comments
 (0)