Skip to content

Purge obsolete workflow runs #3

Purge obsolete workflow runs

Purge obsolete workflow runs #3

name: Purge obsolete workflow runs
on:
workflow_dispatch:
inputs:
slack-notify:
description: 'Notify Slack'
required: true
default: 'true'
type: choice
options:
- 'true'
- 'false'
schedule:
- cron: '16 5 * * 1'
env:
SLACK_NOTIFY: false
permissions: read-all
jobs:
purge-deprecated-workflow-runs:
name: Purge deprecated workflow runs (Local)
permissions:
actions: write
uses: WolfSoftware/reusable-workflows/.github/workflows/reusable-purge-deprecated-workflow-runs.yml@master
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
set-slack-notify:
name: Set Slack Notify
runs-on: ubuntu-latest
outputs:
slack-notify: ${{ steps.set-slack-notify.outputs.slack-notify }}
steps:
- name: Set Slack Notify
id: set-slack-notify
run: |
echo "slack-notify=${{ github.event.inputs.slack-notify || env.SLACK_NOTIFY }}" >> "${GITHUB_OUTPUT}"
slack-workflow-status:
if: always()
name: Slack (Local)
needs:
- purge-deprecated-workflow-runs
- set-slack-notify
uses: WolfSoftware/reusable-workflows/.github/workflows/reusable-slack.yml@master
with:
slack_notify: ${{ needs.set-slack-notify.outputs.slack-notify }}
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}