Skip to content

Commit 016fef5

Browse files
Copilothansec
andauthored
CI: Fix prune_cache workflow to correctly delete PR-scoped caches on close (#10)
* Fix prune_cache.yaml: add workflow_dispatch input for PR number Agent-Logs-Url: https://github.com/hansec/OpenFUSIONToolkit/sessions/9aca4978-aa09-4763-b5b3-ac382a04bba8 Agent-Logs-Url: https://github.com/hansec/OpenFUSIONToolkit/sessions/c36aa2f4-3936-423c-9102-366e4d4dea36 Co-authored-by: hansec <821577+hansec@users.noreply.github.com>
1 parent 7b28e79 commit 016fef5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/prune_cache.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
types:
55
- closed
66
workflow_dispatch:
7+
inputs:
8+
pr_number:
9+
description: 'Pull request number to clean up caches for'
10+
required: true
11+
type: string
712

813
jobs:
914
cleanup:
@@ -21,6 +26,8 @@ jobs:
2126
run: |
2227
gh extension install actions/gh-actions-cache
2328
29+
BRANCH="refs/pull/${PR_NUMBER}/merge"
30+
2431
echo "Fetching list of cache key"
2532
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
2633
@@ -35,4 +42,4 @@ jobs:
3542
env:
3643
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3744
REPO: ${{ github.repository }}
38-
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
45+
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}

0 commit comments

Comments
 (0)