Skip to content

Commit

Permalink
Sends GITHUB_TOKEN when download build-info (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon authored Feb 25, 2024
1 parent 9b743a1 commit 014f467
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/pr-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ jobs:
name: Update PR
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
permissions:
actions: read
steps:
- name: Install Python modules
run: pip install PyGithub
- name: Update PR
run: |
from github import Auth, Github
import json
from urllib.request import urlopen
from urllib.request import Request, urlopen
from zipfile import ZipFile
gh = Github(auth=Auth.Token("${{ secrets.GITHUB_TOKEN }}"))
Expand All @@ -30,7 +28,12 @@ jobs:
if artifact.name == "build-info":
info = artifact
with urlopen(info.archive_download_url) as info:
req = Request(info.archive_download_url, None, {
"Authorization": "Bearer ${{ secrets.GITHUB_TOKEN }}",
"Accept": "application/vnd.github+json"
})
with urlopen(req) as info:
zip = ZipFile(info)
with zip.open("build-info.json") as info:
info = json.load(info)
Expand Down

0 comments on commit 014f467

Please sign in to comment.