add token to fetch bot binary

This commit is contained in:
Pig Fang 2020-07-04 15:20:39 +08:00
parent a6c10ced20
commit 96a3f5d987
No known key found for this signature in database
GPG Key ID: A8198F548DADA9E2

View File

@ -12,9 +12,10 @@ jobs:
steps:
- name: Download bot
run: |
$botRelease = (Invoke-WebRequest 'https://api.github.com/repos/bs-community/telegram-bot/releases/latest').Content | ConvertFrom-Json
$botBinUrl = ((Invoke-WebRequest $botRelease.assets_url).Content | ConvertFrom-Json).browser_download_url
bash -c "curl -fSL $botBinUrl -o bot"
$headers = @{ Authorization: 'Bearer ${{ secrets.GITHUB_TOKEN }}' }
$botRelease = (Invoke-WebRequest -Headers $headers 'https://api.github.com/repos/bs-community/telegram-bot/releases/latest').Content | ConvertFrom-Json
$botBinUrl = ((Invoke-WebRequest -Headers $headers $botRelease.assets_url).Content | ConvertFrom-Json).browser_download_url
bash -c "curl --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -fSL $botBinUrl -o bot"
chmod +x ./bot
shell: pwsh
- name: Run bot