-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (103 loc) · 3.6 KB
/
reusable_housekeeping.yml
File metadata and controls
107 lines (103 loc) · 3.6 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# This workflow combines and handful of useful housekeeping workflows. Each
# individual step can be enabled by using the corresponding `run-XXX` input
# boolean. Actions are disabled by default so they are opt-in.
#
# NOTE: This workflow requires the `secrets.GITHUB_TOKEN`. Be sure to pass it in
# with the `secrets: inherit` keyword.
#
# labels
# The labels action automates adding labels to issues
#
# projects
# The projects action automates adding issues or PR to projects
#
# auto-request-review
# The auto-request-review action is a helper that is a cross between the
# ownership functionality of the CODEOWNERS and the Github team auto
# assignments.
name: Housekeeping
on:
workflow_call:
inputs:
run-labels:
required: false
type: boolean
description: "Indicate if you would like to run the labels action"
default: false
labels-to-add:
required: false
type: string
description: "Comma separated list of labels to add"
default: ""
ignore-if-labeled:
required: false
type: boolean
description: "Indicate if the action should ignore already labelled items"
default: false
run-projects:
required: false
type: boolean
description: "Indicate if you would like to run the projects action"
default: false
project-url:
required: false
type: string
description: "URL to the project"
default: ""
project-labels:
required: false
type: string
description: "labels to filter on for adding to project"
default: ""
project-labels-operator:
required: false
type: string
description: "label operator (AND or NOT) for filtering labels for adding to project"
default: ""
run-auto-request-review:
required: false
type: boolean
description: "Indicate if you would like to run the auto request review action"
default: false
jobs:
# See https://github.com/marketplace/actions/simple-issue-labeler for more
# information on how to use this action
labels:
if: ${{ inputs.run-labels }}
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: andymckay/labeler@master
with:
add-labels: ${{ inputs.labels-to-add }}
ignore-if-labeled: ${{ inputs.ignore-if-labeled }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
# See https://github.com/marketplace/actions/add-to-github-projects for more
# information on how to use this action
projects:
if: ${{ inputs.run-projects }}
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: ${{ inputs.project-url }}
# There is a rollkit level ADD_TO_PROJECT_PAT secret that belongs
# to MSevey who should have sufficient access for all public repos
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: ${{ inputs.project-labels }}
label-operator: ${{ inputs.project-labels-operator }}
# See https://github.com/marketplace/actions/auto-request-review for more
# information on how to use this action
auto-request-review:
if: ${{ inputs.run-auto-request-review }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: necojackarc/[email protected]
with:
# There is a rollkit level PAT_FOR_AUTO_REQUEST_REVIEW secret that
# belongs to MSevey who should have sufficient access for all public
# repos
token: ${{ secrets.PAT_FOR_AUTO_REQUEST_REVIEW }}