generated from ipdxco/github-as-code
-
Notifications
You must be signed in to change notification settings - Fork 26
49 lines (46 loc) · 1.5 KB
/
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
name: Labels
on:
workflow_dispatch:
inputs:
source:
description: 'The source repository to sync labels from'
required: true
targets:
description: 'The target repositories to sync labels to (comma-separated)'
required: true
add:
description: 'Whether to add labels to the target repositories'
required: false
default: true
remove:
description: 'Whether to remove labels from the target repositories'
required: false
default: false
defaults:
run:
shell: bash
jobs:
sync:
permissions:
contents: read
name: Sync
runs-on: ubuntu-latest
env:
GITHUB_APP_ID: ${{ secrets.RW_GITHUB_APP_ID }}
GITHUB_APP_INSTALLATION_ID: ${{ secrets[format('RW_GITHUB_APP_INSTALLATION_ID_{0}', github.repository_owner)] || secrets.RW_GITHUB_APP_INSTALLATION_ID }}
GITHUB_APP_PEM_FILE: ${{ secrets.RW_GITHUB_APP_PEM_FILE }}
TF_WORKSPACE: ${{ github.repository_owner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize scripts
run: npm install && npm run build
working-directory: scripts
- name: Sync
run: node lib/actions/sync-labels.js
working-directory: scripts
env:
SOURCE_REPOSITORY: ${{ github.event.inputs.source }}
TARGET_REPOSITORIES: ${{ github.event.inputs.targets }}
ADD_LABELS: ${{ github.event.inputs.add }}
REMOVE_LABELS: ${{ github.event.inputs.remove }}