From 96a3f5d987b0313efe85cb1ab06ba3aec61d7e40 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 4 Jul 2020 15:20:39 +0800 Subject: [PATCH] add token to fetch bot binary --- .github/workflows/Telegram.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Telegram.yml b/.github/workflows/Telegram.yml index 9ffc8c94..ab1319dd 100644 --- a/.github/workflows/Telegram.yml +++ b/.github/workflows/Telegram.yml @@ -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