GITHUB_TEMPLATES = \
	.github/CODEOWNERS \
	.github/workflows/auto-greet.yml \
	.github/workflows/auto-assign.yml \
	.github/workflows/auto-label.yml \
	.github/workflows/auto-readme.yml \
	.github/workflows/slash-command-dispatch.yml \
	.github/ISSUE_TEMPLATE/config.yml \
	.github/PULL_REQUEST_TEMPLATE.md \
	.github/ISSUE_TEMPLATE/feature_request.md \
	.github/ISSUE_TEMPLATE/bug_report.md \
	.github/ISSUE_TEMPLATE/question.md

$(GITHUB_TEMPLATES): $(addprefix $(BUILD_HARNESS_PATH)/templates/, $(GITHUB_TEMPLATES))
	mkdir -p $(dir $@)
	cp $(BUILD_HARNESS_PATH)/templates/$@ $@
	git ls-files --error-unmatch $@ 2>/dev/null || git add $@

.github/auto-assign.yml:: # do not overwrite config by default
	mkdir -p $(dir $@)
	cp $(BUILD_HARNESS_PATH)/templates/$@ $@
	git ls-files --error-unmatch $@ 2>/dev/null || git add $@

.github/auto-label.yml:: # do not overwrite config by default
	mkdir -p $(dir $@)
	cp $(BUILD_HARNESS_PATH)/templates/$@ $@
	git ls-files --error-unmatch $@ 2>/dev/null || git add $@

.github/slash-command-dispatch.yml:: # do not overwrite config by default
	mkdir -p $(dir $@)
	cp $(BUILD_HARNESS_PATH)/templates/$@ $@
	git ls-files --error-unmatch $@ 2>/dev/null || git add $@

github/init: $(GITHUB_TEMPLATES) .github/auto-assign.yml .github/auto-label.yml .github/slash-command-dispatch.yml
