Skip to content

Cleanup OnDemand

Cleanup OnDemand #24

Workflow file for this run

name: Cleanup OnDemand
on:
pull_request:
types:
- closed
schedule:
- cron: 30 1 * * 6
workflow_call:
inputs:
branch:
type: string
description: Branch to cleanup (e.g. refs/pull/1/merge)
default: ${{ github.ref }}
workflow_dispatch: {}
permissions: read-all
jobs:
stale:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' }}
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Cleanup stale issues and PRs
uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 https://github.com/actions/stale/commit/28ca1036281a5e5922ead5184a1bbf96e5fc984e
with:
any-of-labels: needs-more-info,needs-demo
days-before-close: 5
days-before-pr-close: -1
days-before-stale: 30
exempt-all-pr-assignees: true
exempt-all-pr-milestones: true
exempt-issue-milestones: future,alpha,beta
stale-issue-label: no-issue-activity
stale-issue-message: Message to comment on stale issues. If none provided, will not mark issues stale
stale-pr-label: no-pr-activity
stale-pr-message: Message to comment on stale PRs. If none provided, will not mark PRs stale
cache:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7 https://github.com/actions/checkout/commit/692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
persist-credentials: false
- name: Cleanup cache
shell: bash
run: ./scripts/delete-gh-actions-cache.sh
if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }}
env:
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
GITHUB_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
- name: Cleanup cache
shell: bash
run: ./scripts/delete-gh-actions-cache.sh
if: ${{ github.event_name != 'pull_request' }}
env:
BRANCH: ${{ inputs.branch || github.ref }}
GITHUB_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}