diff --git a/.github/send_download_artifact_url/send-download-artifact-page-url.py b/.github/send_download_artifact_url/send-download-artifact-page-url.py index 1a742ce..6e4e348 100644 --- a/.github/send_download_artifact_url/send-download-artifact-page-url.py +++ b/.github/send_download_artifact_url/send-download-artifact-page-url.py @@ -7,10 +7,10 @@ headers = { "Accept": "application/vnd.github.v3+json", - "Authorization": os.getenv("PERSONAL_ACCESS_TOKEN"), + "Authorization": os.getenv("GITHUB_TOKEN"), } -req = requests.get(f" https://api.github.com/repos/{os.getenv('GITHUB_REPOSITORY')}/actions/artifacts", +res = requests.get(f" https://api.github.com/repos/{os.getenv('GITHUB_REPOSITORY')}/actions/artifacts", headers=headers).json() @@ -32,4 +32,4 @@ def message(url): return content -requests.post(os.getenv("DISCORD_WEBHOOK_URL"), message(get_download_url(req))) \ No newline at end of file +requests.post(os.getenv("DISCORD_WEBHOOK_URL"), message(get_download_url(res))) \ No newline at end of file diff --git a/.github/workflows/build_finish_notify.yml b/.github/workflows/build_finish_notify.yml index cf6a235..55a4593 100644 --- a/.github/workflows/build_finish_notify.yml +++ b/.github/workflows/build_finish_notify.yml @@ -1,7 +1,6 @@ name: 'GitHub Build Finish Notification' env: - PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} on: @@ -27,5 +26,6 @@ jobs: - name: send download artifact page url env: GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | python .github/send_download_artifact_url/send-download-artifact-page-url.py \ No newline at end of file