mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-26 14:10:19 +00:00
31 lines
737 B
YAML
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
|