generated from octomation/go-tool
-
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.6 KB
/
runs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Workflow invalidation
on:
workflow_dispatch:
inputs:
pattern:
description: The name of workflow to clean.
type: choice
options:
- Cache invalidation
- Continuous integration
- Continuous integration healthcheck
- Dependabot at weekends
- Documentation delivery
- Tools validation
- Workflow invalidation
default: Workflow invalidation
required: true
dry_run:
description: Only log actions, do not perform any delete operations.
type: boolean
required: false
jobs:
delete:
name: Deleting
runs-on: ubuntu-latest
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2.0.6
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
delete_workflow_pattern: ${{ github.event.inputs.pattern }}
dry_run: ${{ fromJSON('["", "true"]')[github.event.inputs.dry_run == 'true'] }}
retain_days: 0
keep_minimum_runs: 0
notify:
name: Notifying
needs: [ delete ]
runs-on: ubuntu-latest
if: failure() || success()
steps:
- name: Send Slack notification
uses: rtCamp/action-slack-notify@v2.3.0
env:
SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }}
SLACK_ICON: https://github.com/github.png?size=64
SLACK_TITLE: '🗑️ ${{ github.repository }}: ${{ github.workflow }}'
SLACK_USERNAME: GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}