File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ $repo = $env:INPUT_REPO
3
3
$keyword = $env: INPUT_KEYWORD
4
4
$owner = $env: INPUT_OWNER
5
5
6
+
6
7
$tagsUrl = " https://api.github.com/repos/$owner /$repo /git/refs/tags"
7
8
$headers = @ {
8
9
" Authorization" = " token $token "
@@ -17,14 +18,20 @@ $response = Invoke-RestMethod -Uri $tagsUrl -Headers $headers -Method Get
17
18
18
19
foreach ($tag in $response ) {
19
20
$tagName = $tag.url
20
-
21
+ $deleteUrl = $tag .url
21
22
22
23
23
24
24
25
if ($tagName -like " *$keyword *" ) {
25
26
26
- $deleteUrl = " https://api.github.com/repos/$owner /$repo /git/$tagName "
27
- Invoke-RestMethod - Uri $tagname - Headers $headers - Method Delete
28
- Write-Host " Deleted tag: $tagName "
27
+ try {
28
+ Invoke-RestMethod - Uri $tagname - Headers $headers - Method Delete
29
+
30
+ Write-Host " Deleted tag: $tagName "
31
+
32
+ }
33
+ catch {
34
+ Write-Host " Error deleting release: $releaseVersion . $_ "
35
+ }
29
36
}
30
37
}
You can’t perform that action at this time.
0 commit comments