From 895ab1c7820b94fbff8ddd0b1f86ba95498b589c Mon Sep 17 00:00:00 2001 From: pranc1ngpegasus Date: Tue, 15 Oct 2024 12:34:30 +0900 Subject: [PATCH] feat: delete closed pull request cache --- action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 84efd1c..579882c 100644 --- a/action.yml +++ b/action.yml @@ -11,8 +11,13 @@ runs: gh extension install actions/gh-actions-cache mergedPRNumbers=$(gh pr list --state merged --json number | jq -r '.[].number') - for prNumber in $mergedPRNumbers do gh actions-cache list -L 100 -B refs/pull/$prNumber/merge | cut -f 1 | xargs -I{} gh actions-cache delete --confirm {} done + + closedPRNumbers=$(gh pr list --state closed --json number | jq -r '.[].number') + for prNumber in $closedPRNumbers + do + gh actions-cache list -L 100 -B refs/pull/$prNumber/merge | cut -f 1 | xargs -I{} gh actions-cache delete --confirm {} + done