-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
51 lines (49 loc) · 1.44 KB
/
action.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
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action
name: Add labels
inputs:
title:
required: true
github-token:
required: true
runs:
using: composite
steps:
- name: Extract Label
id: extract-label
shell: bash
run: |
echo "::set-output name=labels_to_add::$(
node -e "
const title = process.env.TITLE;
const labelMapping = {
chore: 'chore',
feat: 'feature',
fix: 'bugfix',
refactor: 'enhancement',
test: 'testing',
};
const foundKey = Object.keys(labelMapping).find((label) => title && title.startsWith(label));
console.log(foundKey ? labelMapping[foundKey] : '');
"
)"
env:
TITLE: ${{ inputs.title }}
- uses: actions-ecosystem/[email protected]
with:
github_token: ${{ inputs.github-token }}
labels: ${{ steps.extract-label.outputs.labels_to_add }}
- uses: codelytv/pr-size-labeler@v1
with:
github_token: ${{ inputs.github-token }}
xs_label: 'size/xs'
xs_max_size: '10'
s_label: 'size/s'
s_max_size: '100'
m_label: 'size/m'
m_max_size: '250'
l_label: 'size/l'
l_max_size: '500'
xl_label: 'size/xl'
message_if_xl: ''
fail_if_xl: 'false'
files_to_ignore: 'pnpm-lock.yaml'