Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add make command to update template #2212

Merged
merged 6 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions .github/workflows/update-pull-request-and-issue-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,12 @@ jobs:
git checkout main
git checkout -b ${BRANCH_NAME}

GO_VERSION=$(make version/go)
NGT_VERSION=$(make version/ngt)
KUBECTL_VERSION=$(make version/k8s)
make update/template

sed -i -e "s/^- Go Version: .*$/- Go Version: ${GO_VERSION}/" .github/ISSUE_TEMPLATE/bug_report.md
sed -i -e "s/^- Go Version: .*$/- Go Version: ${GO_VERSION}/" .github/ISSUE_TEMPLATE/security_issue_report.md
sed -i -e "s/^- Go Version: .*$/- Go Version: ${GO_VERSION}/" .github/PULL_REQUEST_TEMPLATE.md

sed -i -e "s/^- NGT Version: .*$/- NGT Version: ${NGT_VERSION}/" .github/ISSUE_TEMPLATE/bug_report.md
sed -i -e "s/^- NGT Version: .*$/- NGT Version: ${NGT_VERSION}/" .github/ISSUE_TEMPLATE/security_issue_report.md
sed -i -e "s/^- NGT Version: .*$/- NGT Version: ${NGT_VERSION}/" .github/PULL_REQUEST_TEMPLATE.md

sed -i -e "s/^- Kubernetes Version: .*$/- Kubernetes Version: ${KUBECTL_VERSION}/" .github/ISSUE_TEMPLATE/bug_report.md
sed -i -e "s/^- Kubernetes Version: .*$/- Kubernetes Version: ${KUBECTL_VERSION}/" .github/ISSUE_TEMPLATE/security_issue_report.md
sed -i -e "s/^- Kubernetes Version: .*$/- Kubernetes Version: ${KUBECTL_VERSION}/" .github/PULL_REQUEST_TEMPLATE.md
if git diff --quiet --exit-code; then
echo "Nothing updated"
exit 0
fi

git add .github/PULL_REQUEST_TEMPLATE.md .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/security_issue_report.md
git commit -S --signoff -m ":robot: Automatically update PULL_REQUEST_TEMPLATE and ISSUE_TEMPLATE"
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ update: \
update/libs \
proto/all \
deps \
update/template \
format \
go/deps

Expand Down
18 changes: 18 additions & 0 deletions Makefile.d/dependencies.mk
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,21 @@ update/vald:
## update vald client library made by clojure self version
update/valdcli:
curl --silent https://api.github.com/repos/vdaas/vald-client-clj/releases/latest | grep -Po '"tag_name": "\K.*?(?=")' > $(ROOTDIR)/versions/VALDCLI_VERSION

.PHONY: update/template
## update PULL_REQUEST_TEMPLATE and ISSUE_TEMPLATE
update/template:
$(eval TMPL_GO_VERSION := $(shell cat $(ROOTDIR)/versions/GO_VERSION))
$(eval TMPL_KUBECTL_VERSION := $(shell cat $(ROOTDIR)/versions/KUBECTL_VERSION))
$(eval TMPL_NGT_VERSION := $(shell cat $(ROOTDIR)/versions/NGT_VERSION))
sed -i -e "s/^- Go Version: .*$$/- Go Version: $(TMPL_GO_VERSION)/" $(ROOTDIR)/.github/ISSUE_TEMPLATE/bug_report.md
vankichi marked this conversation as resolved.
Show resolved Hide resolved
sed -i -e "s/^- Go Version: .*$$/- Go Version: $(TMPL_GO_VERSION)/" $(ROOTDIR)/.github/ISSUE_TEMPLATE/security_issue_report.md
sed -i -e "s/^- Go Version: .*$$/- Go Version: $(TMPL_GO_VERSION)/" $(ROOTDIR)/.github/PULL_REQUEST_TEMPLATE.md

sed -i -e "s/^- NGT Version: .*$$/- NGT Version: $(TMPL_NGT_VERSION)/" $(ROOTDIR)/.github/ISSUE_TEMPLATE/bug_report.md
sed -i -e "s/^- NGT Version: .*$$/- NGT Version: $(TMPL_NGT_VERSION)/" $(ROOTDIR)/.github/ISSUE_TEMPLATE/security_issue_report.md
sed -i -e "s/^- NGT Version: .*$$/- NGT Version: $(TMPL_NGT_VERSION)/" $(ROOTDIR)/.github/PULL_REQUEST_TEMPLATE.md

sed -i -e "s/^- Kubernetes Version: .*$$/- Kubernetes Version: $(TMPL_KUBECTL_VERSION)/" $(ROOTDIR)/.github/ISSUE_TEMPLATE/bug_report.md
sed -i -e "s/^- Kubernetes Version: .*$$/- Kubernetes Version: $(TMPL_KUBECTL_VERSION)/" $(ROOTDIR)/.github/ISSUE_TEMPLATE/security_issue_report.md
sed -i -e "s/^- Kubernetes Version: .*$$/- Kubernetes Version: $(TMPL_KUBECTL_VERSION)/" $(ROOTDIR)/.github/PULL_REQUEST_TEMPLATE.md