-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 2.5 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
66
67
68
69
70
71
72
73
74
75
76
77
##
# GitHub Action that syncs labels from the parent `template-core` Repository.
#
# @link https://github.com/andrewvaughan/template-core/labels
#
---
name: Replace GitHub Labels with Standard
on:
# This action must trigger manually from the GitHub Actions interface
workflow_dispatch:
##
# All steps should have read-only access, unless explicitly given.
#
permissions: read-all
##
# Sync labels from `andrewvaughan/template-core` parent Repository.
#
# @link https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow
#
jobs:
sync-labels:
name: Replace GitHub Labels with Standard
runs-on: ubuntu-latest
##
# This job's `GITHUB_TOKEN` or `PAT` must have these permissions.
#
# Always aim to provide as few permissions as possible for personal access tokens.
#
# @link https://docs.github.com/en/actions/security-guides/automatic-token-authentication
#
permissions:
contents: read
issues: write
steps:
##
# Checkout just the label configuration from this project for the sync manager to access.
#
- name: Checkout Label configuration
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #@v4.1.7
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 1
sparse-checkout: |
.github/.config/labels.yml
##
# Sync the labels from the parent Repository.
#
# @see {@link https://github.com/marketplace/actions/label-sync}
#
- name: Sync Labels
uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # @v2.3.3
with:
# Configure from the label configuration imported from `template-core`
config-file: .github/.config/labels.yml
# This can also stay up to date with the `template-core` Repository Labels, but this may cause issues with
# automation and isn't generally recommended:
# source-repo: andrewvaughan/template-core
# If you're using a private source repo or a URL that needs an 'Authorization' header, you'll need to add a
# custom token for the action to read it
request-token: ${{ secrets.GITHUB_TOKEN }}
# Delete any Labels that don't meet the standard
delete-other-labels: true
# Available for dry-run testing, if needed
# dry-run: true
# By default, this uses the user's `GITHUB_TOKEN`, but any PAT can live here with appropriate permissions
token: ${{ secrets.GITHUB_TOKEN }}