mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-16 21:02:57 +08:00
acdbec61c4
[skip ci]
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
name: Clean up PR cache
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- closed
|
|
workflow_dispatch:
|
|
inputs:
|
|
pr_number:
|
|
description: 'Pull request number'
|
|
required: true
|
|
type: number
|
|
|
|
jobs:
|
|
cleanup:
|
|
runs-on: ubuntu-slim
|
|
timeout-minutes: 5
|
|
permissions:
|
|
actions: write
|
|
steps:
|
|
- name: Delete caches of the PR
|
|
run: gh cache delete --all --repo "$REPO" --ref "$REF" --succeed-on-no-caches
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
REPO: ${{ github.repository }}
|
|
REF: refs/pull/${{ github.event.pull_request.number || inputs.pr_number }}/merge
|
|
|
|
- name: Delete caches of the PR branch
|
|
if: github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == github.repository
|
|
run: gh cache delete --all --repo "$REPO" --ref "$REF" --succeed-on-no-caches
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
REPO: ${{ github.repository }}
|
|
REF: refs/heads/${{ github.event.pull_request.head.ref }}
|