-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
53 lines (48 loc) · 1.67 KB
/
action.yaml
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
name: "Add Labels Action"
description: "Adds `type/...` and `component/...` labels by PR title using commitlint format and custom config."
inputs:
github_owner:
description: "Owner of the repository"
default: ${{ github.repository_owner }}
github_repo:
description: "Repository name"
default: ${{ github.event.repository.name }}
github_token:
description: "GitHub token"
default: ${{ github.token }}
github_pr_number:
description: "GitHub PR number"
default: ${{ github.event.pull_request.number }}
github_pr_title:
description: "GitHub PR title"
default: ${{ github.event.pull_request.title }}
runs:
using: "composite"
steps:
- name: Get current labels from PR
id: get_labels
shell: bash
run: ${{ github.action_path }}/src/labels/get.sh
env:
REPO: ${{ inputs.github_owner }}/${{ inputs.github_repo }}
PR_NUMBER: ${{ inputs.github_pr_number }}
GH_TOKEN: ${{ inputs.github_token }}
- name: Construct labels to add/delete
id: construct_labels
shell: bash
run: ${{ github.action_path }}/src/construct_labels.sh
env:
PR_TITLE: ${{ inputs.github_pr_title }}
CURRENT_LABELS: ${{ steps.get_labels.outputs.labels }}
- name: Add labels
shell: bash
run: ${{ github.action_path }}/src/labels/set.sh
if: ${{ steps.construct_labels.outputs.labels_to_add != '' }}
env:
LABELS: ${{ steps.construct_labels.outputs.labels_to_add }}
REPO: ${{ inputs.github_owner }}/${{ inputs.github_repo }}
PR_NUMBER: ${{ inputs.github_pr_number }}
GH_TOKEN: ${{ inputs.github_token }}
branding:
icon: "tag"
color: "gray-dark"