Skip to content

Commit 3f4794e

Browse files
author
Tom Grobbe
committed
test ps
1 parent e2b225d commit 3f4794e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

appveyor/on_success.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
if (-not $env:WEBHOOK_URL) { goto file }
2+
3+
Invoke-RestMethod -Uri $env:WEBHOOK_URL -Method Post -ContentType "application/x-www-form-urlencoded" -Body @{
4+
success = "true"
5+
commit_id = $env:APPVEYOR_REPO_COMMIT.Substring(0, 7)
6+
project_name = $env:APPVEYOR_PROJECT_NAME
7+
build_url = "$env:APPVEYOR_URL/project/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/builds/$env:APPVEYOR_BUILD_ID"
8+
author = "Vespura"
9+
commit_url = "https://github.com/$env:APPVEYOR_REPO_NAME/commit/$env:APPVEYOR_REPO_COMMIT"
10+
commit_message = $env:APPVEYOR_REPO_COMMIT_MESSAGE
11+
build_name = "$env:APPVEYOR_PROJECT_NAME-$env:APPVEYOR_BUILD_ID-$env:APPVEYOR_BUILD_NUMBER"
12+
}
13+
Write-Output "Success webhook sent."
14+
15+
:file
16+
Write-Output "Past :file"
17+
18+
if (-not $env:DISCORD_FILE_WEBHOOK) { goto end }
19+
Invoke-RestMethod -Uri $env:DISCORD_FILE_WEBHOOK -Method Post -InFile "vMenu-$env:VERSION_NAME.zip" -ContentType "multipart/form-data"
20+
Write-Output "File webhook sent."
21+
22+
:end
23+
Write-Output "Past :end"

0 commit comments

Comments
 (0)