Skip to content

Commit

Permalink
fix: Make sure we delete the right caches (#1004)
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer authored Feb 12, 2024
1 parent 6de5df9 commit 5984b9a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/clean-cache-post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,29 @@ on:
types:
- closed
workflow_dispatch:
inputs:
branch:
description: "Branch name"
required: false
default: ""

jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Setup Branch Name
id: setup-branch
run: |
if [ "${{ github.event.inputs.branch }}" != "" ]; then
echo "branch=${{ github.event.inputs.branch }}" >> $GITHUB_OUTPUT
elif [ "${{ github.head_ref }}" != "" ]; then
echo "branch=${{ github.head_ref }}" >> $GITHUB_OUTPUT
else
echo "branch=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
Expand All @@ -32,4 +48,4 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
BRANCH: ${{ steps.setup-branch.outputs.branch }}

0 comments on commit 5984b9a

Please sign in to comment.