bottom/.github/workflows/clear-pr-cache.yml
2022-11-06 03:46:51 -05:00

31 lines
737 B
YAML

# Simple job to clear the cache used by a PR when it is closed/merged.
name: "clear PR cache"
on:
workflow_dispatch:
inputs:
id:
description: "Which id to clear:"
required: false
pull_request:
types:
- closed
jobs:
clear-cache:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- run: |
if [[ -z "${{ github.event.inputs.id }}" ]]; then
python ./scripts/clear_cache.py ${{ github.event.pull_request.number }}
else
python ./scripts/clear_cache.py ${{ github.event.inputs.id }}
fi