Skip to content

Instantly share code, notes, and snippets.

@Callisto13
Last active November 16, 2022 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Callisto13/a03498c5900b913791222625fb7a3040 to your computer and use it in GitHub Desktop.
Save Callisto13/a03498c5900b913791222625fb7a3040 to your computer and use it in GitHub Desktop.
Set up a new repo with preferred labels

Script using https://github.com/clok/ghlabels to apply preferred labels to new repos, or update existing ones.

Usage:

./labels.sh -c labelcfg.yaml \
  -r <org>/<name> \
  -r <user/name>
---
rename: []
remove:
- documentation
- enhancement
- invalid
- bug
sync:
- name: kind/documentation
color: 838AB0
description: "Documentation only"
- name: kind/improvement
color: DDE312
description: "Superficial improvement, not a feature or a bug"
- name: wontfix
color: ffffff
description: This will not be worked on
- name: help wanted
color: "008672"
description: Requires help from contributors to get done
- name: kind/cleanup
color: 39A2D2
description: "Removing things previously overlooked"
- name: kind/dependencies
color: 5640CE
description: Change/request only involves dependencies
- name: kind/refactor
color: D056E1
description: "Only refactoring changes"
- name: kind/test
color: "046569"
description: "Updates to tests only"
- name: question
color: C8E095
description: Further information is requested
- name: good first issue
color: 7057ff
description: Good for newcomers
- name: kind/bug
color: B60205
description: "Something isn't working"
- name: kind/feature
color: 1BF534
description: "New feature or request"
- name: kind/regression
color: 7F043D
description: "Regression has been spotted/introduced"
- name: duplicate
color: cfd3d7
description: This issue or pull request already exists
- name: kind/chore
color: 8C7D77
description: "Neither feature nor bug nor improvement. Busy work"
#!/bin/bash
if [ -z "$GITHUB_TOKEN" ]; then
echo "usage: GITHUB_TOKEN must be exported. PAT with repo scope."
exit 1
fi
curl https://i.jpillora.com/clok/ghlabels! | bash
repos=()
config=""
while [ $# -gt 0 ]; do
case "$1" in
-c | --config)
shift
config="$1"
;;
-r | --repo)
shift
repos+=("$1")
;;
-*)
echo "Unknown arg: $1."
exit 1
;;
*)
break
;;
esac
shift
done
for repo in "${repos[@]}"; do
ghlabels sync repo -c "$config" -r "$repo"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment