bottom/.github/workflows/clear-pr-cache.yml

32 lines
737 B
YAML
Raw Normal View History

# 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:
2022-11-06 11:46:51 +03:00
- 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