-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (57 loc) · 1.95 KB
/
reusable-labelsync.yml
File metadata and controls
59 lines (57 loc) · 1.95 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
name: label-sync
on:
workflow_call:
inputs:
operating-system:
description: The operating system to use (default `ubuntu-latest`)
required: false
default: ubuntu-latest
type: string
with-submodules:
description: Whether to include submodules when checking out the repository (default `false`)
required: false
default: 'false'
type: string
merge-labels:
description: Whether to merge labels or not
required: false
default: false
type: boolean
repository-overwrite-labels:
description: The repository to get overwrite labels from. Only used if merge-labels is true!
required: false
type: string
jobs:
label-sync:
name: Label Sync
runs-on: ${{ inputs.operating-system }}
steps:
- name: Checkout Core Labels
uses: actions/checkout@v4
with:
path: core-labels
sparse-checkout: .github/labels.yml
sparse-checkout-cone-mode: false
repository: zendrex/zendrex
submodules: ${{ inputs.with-submodules }}
- name: Checkout Overwrite Labels
if: inputs.merge-labels == true
uses: actions/checkout@v4
with:
path: overwrite-labels
sparse-checkout: .github/labels.yml
sparse-checkout-cone-mode: false
repository: ${{ inputs.repository-overwrite-labels }}
submodules: ${{ inputs.with-submodules }}
- name: Merge labels
if: inputs.merge-labels == true
run: |
yq '. *+ load("core-labels/.github/labels.yml")' overwrite-labels/.github/labels.yml > labels.yml
- name: Move Core labels
if: inputs.merge-labels == false
run: mv core-labels/.github/labels.yml labels.yml
- name: Run Label Sync
uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: labels.yml