From 94730e998bad5efc5a423c95d9921910796c7ee4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 Feb 2024 06:39:55 +0100 Subject: [PATCH] Better workflow for prune. --- .github/workflows/cleanup.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index dfedc874b6..0be8f1c3fc 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -2,6 +2,9 @@ name: "Chore - Prune old builds" +permissions: + actions: write + on: schedule: - cron: '0 0 * * *' @@ -14,7 +17,7 @@ jobs: - name: Prune cancelled/skipped runs uses: actions/github-script@v7 with: - github-token: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} script: | const cancelled = await github.rest.actions.listWorkflowRunsForRepo({ owner: context.repo.owner, @@ -44,7 +47,7 @@ jobs: - name: Prune runs older than 3 days uses: actions/github-script@v7 with: - github-token: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} script: | const days_to_expiration = 3; const ms_in_day = 86400000;