From f4a712b271703382bdc161193f644de0fdc561bf Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 22 Jun 2023 19:16:06 +0300 Subject: [PATCH] ci: delete old workflow runs for `pr-cleanup.yaml`(#8146) --- .github/workflows/stale.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 89b32f7d3d..04291c1ddf 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -1,4 +1,4 @@ -name: Stale Issue and Branch Cleanup +name: Stale Issue, Banch and Old Workflows Cleanup on: schedule: # Every day at midnight @@ -10,6 +10,7 @@ jobs: permissions: issues: write pull-requests: write + actions: write steps: - uses: actions/stale@v8.0.0 with: @@ -42,3 +43,14 @@ jobs: delete_tags: false # extra_protected_branch_regex: ^(foo|bar)$ exclude_open_pr_branches: true + del_runs: + runs-on: ubuntu-latest + steps: + - name: Delete workflow runs + uses: Mattraks/delete-workflow-runs@v2 + with: + token: ${{ github.token }} + repository: ${{ github.repository }} + retain_days: 1 + keep_minimum_runs: 1 + delete_workflow_pattern: pr-cleanup.yaml