Skip to content

Commit 54afe14

Browse files
authored
Merge pull request #5 from 107-systems/label-manager-workflow
Add a CI workflow to sync organization-wide labels
2 parents f53a488 + ac4c8a9 commit 54afe14

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Manage Repository Labels
2+
3+
on:
4+
push:
5+
paths:
6+
- ".github/workflows/manage-labels.yml"
7+
- ".github/repository-labels-data/*.json"
8+
schedule:
9+
# run every Tuesday at 3 AM UTC
10+
- cron: "0 3 * * 2"
11+
# workflow_dispatch event allows the workflow to be triggered manually
12+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
13+
workflow_dispatch:
14+
15+
jobs:
16+
manage-labels:
17+
runs-on: ubuntu-latest
18+
19+
env:
20+
# All JSON files in this folder will be merged.
21+
SOURCE_DATA_FOLDER_PATH: .github/repository-labels-data
22+
# See: https://github.com/lannonbr/issue-label-manager-action#usage
23+
MERGED_DATA_FILE_PATH: .github/labels.json
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- name: Download universal labels data file
29+
uses: carlosperate/[email protected]
30+
with:
31+
file-url: https://raw.githubusercontent.com/107-systems/.github/main/universal-repository-labels.json
32+
location: ${{ env.SOURCE_DATA_FOLDER_PATH }}
33+
34+
- name: Merge labels data files
35+
run: |
36+
# Merge all data files and output to the location used by lannonbr/issue-label-manager-action
37+
jq -s '.=.|add|.' "${{ env.SOURCE_DATA_FOLDER_PATH }}"/*.json > "${{ env.MERGED_DATA_FILE_PATH }}"
38+
39+
- name: Update labels
40+
uses: lannonbr/[email protected]
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)