Skip to content

Commit 5a1ccef

Browse files
committed
Declaratively define (and sync) labels
This adds a GitHub Action workflow to sync the labels from a YAML file in `.github/labels.yaml`, in combination with fetching the standard labels from `fluxcd/community`. At present, there are no custom labels for the repository itself. But the `.github/labels.yaml` file is added as boilerplate. Signed-off-by: Hidde Beydals <[email protected]>
1 parent 86189a5 commit 5a1ccef

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

.github/dependabot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
updates:
44
- package-ecosystem: "github-actions"
55
directory: "/"
6-
labels: ["area/build"]
6+
labels: ["area/ci", "dependencies"]
77
schedule:
8-
# by default this will be on a monday.
8+
# By default, this will be on a monday.
99
interval: "weekly"

.github/labels.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Configuration file to declaratively configure labels
2+
# Ref: https://github.com/EndBug/label-sync#Config-files
3+
4+
# TODO: enable this when we have a release/v1.0.x branch
5+
#- name: backport:release/v1.0.x
6+
# description: To be backported to release/v1.0.x
7+
# color: '#ffd700'

.github/workflows/sync-labels.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: sync-labels
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- .github/labels.yaml
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
labels:
15+
name: Run sync
16+
runs-on: ubuntu-latest
17+
permissions:
18+
issues: write
19+
steps:
20+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
21+
- uses: EndBug/label-sync@da00f2c11fdb78e4fae44adac2fdd713778ea3e8 # v2.3.2
22+
with:
23+
# Configuration file
24+
config-file: |
25+
https://raw.githubusercontent.com/fluxcd/community/main/.github/standard-labels.yaml
26+
.github/labels.yaml
27+
# Strictly declarative
28+
delete-other-labels: true

0 commit comments

Comments
 (0)