From 9b743a1d71407717992fff28186641f6afffa3a0 Mon Sep 17 00:00:00 2001 From: Putta Khunchalee Date: Sun, 25 Feb 2024 19:28:46 +0700 Subject: [PATCH] Grants 'actions: read' to Update PR Actions (#697) --- .github/workflows/pr-update.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-update.yml b/.github/workflows/pr-update.yml index 0a235b237..9525b62b4 100644 --- a/.github/workflows/pr-update.yml +++ b/.github/workflows/pr-update.yml @@ -9,6 +9,8 @@ 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 @@ -19,10 +21,9 @@ jobs: from urllib.request import urlopen from zipfile import ZipFile - event = json.loads('''${{ toJSON(github.event.workflow_run) }}''') gh = Github(auth=Auth.Token("${{ secrets.GITHUB_TOKEN }}")) repo = gh.get_repo("${{ github.repository }}") - run = repo.get_workflow_run(event["id"]) + run = repo.get_workflow_run(${{ github.event.workflow_run.id }}) info = None for artifact in run.get_artifacts():