-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
91 lines (78 loc) · 3.04 KB
/
justfile
File metadata and controls
91 lines (78 loc) · 3.04 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
set shell := ["bash", "-euo", "pipefail", "-c"]
set unstable
# ---------------------------------------------------------------------------- #
# DEPENDENCIES #
# ---------------------------------------------------------------------------- #
# https://github.com/Financial-Times/github-label-sync
github-label-sync := require("github-label-sync")
# ---------------------------------------------------------------------------- #
# CONSTANTS #
# ---------------------------------------------------------------------------- #
OWNER := "PaulRBerg"
LABELS_DEFAULT := "./labels/default.yml"
GITHUB_TOKEN := env("GITHUB_TOKEN")
# ---------------------------------------------------------------------------- #
# RECIPES #
# ---------------------------------------------------------------------------- #
# Show available commands
default:
@just --list
# Apply default labels to all repositories, preserving existing labels
[confirm("This will sync GitHub labels across all repositories. Continue? y/N")]
@apply-all:
just apply-all-impl
# Apply default labels to a specific repository, preserving existing labels
[confirm("This will sync GitHub labels to the specified repository. Continue? y/N")]
apply-repo repo:
github-label-sync \
--access-token {{ GITHUB_TOKEN }} \
--allow-added-labels \
--labels {{ LABELS_DEFAULT }} \
{{ OWNER }}/{{ repo }}
# Apply default labels to a specific repository, overwriting existing labels
[confirm("WARNING: This will delete any labels not listed in labels.yml! Continue? y/N")]
apply-repo-overwrite repo:
github-label-sync \
--access-token {{ GITHUB_TOKEN }} \
--labels {{ LABELS_DEFAULT }} \
{{ OWNER }}/{{ repo }}
# Show default labels
show-labels:
@echo "Default labels configuration:"
@cat {{ LABELS_DEFAULT }}
# ---------------------------------------------------------------------------- #
# RECIPES: HELPERS #
# ---------------------------------------------------------------------------- #
# Apply default labels to all repositories
[private]
[script]
apply-all-impl:
repos=(
"cryptfolio-scripts"
"dot-claude"
"evm-bn"
"foundry-multibuild"
"foundry-template"
"hardhat-packager"
"hardhat-template"
"javascript-template"
"multisol"
"next-template"
"PaulRBerg.github.io"
"prb-contracts"
"prb-longevity"
"prb-math"
"prb-proxy"
"prb-pulse"
"prb-test"
"rust-template"
"typescript-template"
)
for repo in "${repos[@]}"; do
echo "Syncing labels for {{ OWNER }}/$repo..."
github-label-sync \
--access-token {{ GITHUB_TOKEN }} \
--allow-added-labels \
--labels {{ LABELS_DEFAULT }} \
"{{ OWNER }}/$repo"
done