-
Notifications
You must be signed in to change notification settings - Fork 14
65 lines (65 loc) · 2.15 KB
/
sync-labels.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
55
56
57
58
59
60
61
62
63
64
65
name: Sync labels
on:
workflow_dispatch: {}
# Disabled for now while we're testing
# push:
# branches:
# - develop
# paths:
# - .github/labels.yml
workflow_call:
inputs:
LABELS:
description: |
List of label sources, one per line. Sources can either be GitHub repository
slugs or paths to local YAML files in the format specified in
https://github.com/Financial-Times/github-label-sync#label-config-file".
The sources will merge/override each other in the order they were specified in.
type: string
default: |
.github/labels.yml
required: true
DELETE:
description: |
Remove labels that exist in the repository but are missing from all sources
type: boolean
default: false
WET:
description: |
Write changes, *don't* run in dry mode
type: boolean
default: false
secrets:
ELEMENT_BOT_TOKEN:
description: Sufficiently privileged GitHub token
required: true
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Check out calling repository
uses: actions/checkout@v4
if: github.repository != 'element-hq/element-meta'
- name: Check out element-hq/element-meta
uses: actions/checkout@v4
with:
path: element-meta
repository: element-hq/element-meta
- name: "Set up Node.js"
uses: actions/setup-node@v4
with:
cache: yarn
cache-dependency-path: element-meta/yarn.lock
- name: Install Deps
run: "yarn install --frozen-lockfile"
working-directory: element-meta
- name: "Sync labels"
run: |
yarn sync-labels $(echo -e "${{ inputs.LABELS }}" | xargs -r printf -- '--labels \"%s\"\n' | xargs echo) \
${{ github.repository != 'element-hq/element-meta' && '--dir ..' }} \
${{ inputs.DELETE && '--delete' }} \
${{ inputs.WET && '--wet' }}
working-directory: element-meta
env:
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}