Add option to unpublish package (#12284)
* Add option to unpublish package
This commit is contained in:
Родитель
3f6f5ed74b
Коммит
f2f85ec4f7
|
@ -3,7 +3,7 @@ trigger: none
|
|||
# This pipeline helps to run NPM admin tasks like remove or add tag to a released package version or deprecate a pacakge version
|
||||
# Following variables should be set at queue time to run this pipeline
|
||||
# variable name: TaskType
|
||||
# valid Options: 'AddTag', 'RemoveTag', 'DeprecatePackage'
|
||||
# valid Options: 'AddTag', 'RemoveTag', 'Deprecate', 'Unpublish'
|
||||
|
||||
# variable name: PackageName
|
||||
# e.g. values: '@azure/storage-blob', '@azure/core-http'
|
||||
|
@ -22,7 +22,8 @@ parameters:
|
|||
values:
|
||||
- AddTag
|
||||
- RemoveTag
|
||||
- DeprecatePackage
|
||||
- Deprecate
|
||||
- Unpublish
|
||||
|
||||
- name: PackageName
|
||||
displayName: Package Name (e.g. @azure/template)
|
||||
|
|
|
@ -37,7 +37,7 @@ try {
|
|||
npm dist-tag rm $nameAndVersion $tagName
|
||||
}
|
||||
|
||||
"DeprecatePackage" {
|
||||
"Deprecate" {
|
||||
if ($reason -eq '') {
|
||||
Write-Host "Reason cannot be empty to deprecate package version"
|
||||
exit 1
|
||||
|
@ -47,6 +47,12 @@ try {
|
|||
npm deprecate $nameAndVersion $reason
|
||||
}
|
||||
|
||||
"Unpublish" {
|
||||
Write-Host "Unpublish package $nameAndVersion"
|
||||
Write-Host "npm unpublish $($nameAndVersion)"
|
||||
npm unpublish $nameAndVersion
|
||||
}
|
||||
|
||||
default {
|
||||
Write-Host "Invalid taskType to run npm admin job."
|
||||
exit 1
|
||||
|
|
Загрузка…
Ссылка в новой задаче