From b99f69257e91c2351b9bdc2afc03315f13f94deb Mon Sep 17 00:00:00 2001 From: Rain Sallow Date: Tue, 23 Jul 2024 15:43:14 -0400 Subject: [PATCH] (maint) Add GitReleaseManager templates --- .templates/default/create/footer.sbn | 10 ++++++++++ .templates/default/index.sbn | 10 ++++++++++ .templates/default/issue-details.sbn | 5 +++++ .templates/default/issue-note.sbn | 6 ++++++ .templates/default/issues.sbn | 4 ++++ .templates/default/milestone.sbn | 2 ++ .templates/default/release-info.sbn | 10 ++++++++++ 7 files changed, 47 insertions(+) create mode 100644 .templates/default/create/footer.sbn create mode 100644 .templates/default/index.sbn create mode 100644 .templates/default/issue-details.sbn create mode 100644 .templates/default/issue-note.sbn create mode 100644 .templates/default/issues.sbn create mode 100644 .templates/default/milestone.sbn create mode 100644 .templates/default/release-info.sbn diff --git a/.templates/default/create/footer.sbn b/.templates/default/create/footer.sbn new file mode 100644 index 0000000..f6ba18e --- /dev/null +++ b/.templates/default/create/footer.sbn @@ -0,0 +1,10 @@ +{{ if config.create.include_footer }} + +### {{ config.create.footer_heading }} + +{{ if config.create.milestone_replace_text + replace_milestone_title config.create.footer_content config.create.milestone_replace_text milestone.target.title + else + config.create.footer_content + end +end }} diff --git a/.templates/default/index.sbn b/.templates/default/index.sbn new file mode 100644 index 0000000..ff7eac8 --- /dev/null +++ b/.templates/default/index.sbn @@ -0,0 +1,10 @@ +{{- + include 'release-info' + if milestone.target.description + include 'milestone' + end + include 'issues' | string.rstrip + if template_kind == "CREATE" + include 'create/footer' + end +~}} diff --git a/.templates/default/issue-details.sbn b/.templates/default/issue-details.sbn new file mode 100644 index 0000000..9fa3cce --- /dev/null +++ b/.templates/default/issue-details.sbn @@ -0,0 +1,5 @@ +### {{ issue_label }} + +{{ for issue in issues.items[issue_label] + include 'issue-note' +end }} diff --git a/.templates/default/issue-note.sbn b/.templates/default/issue-note.sbn new file mode 100644 index 0000000..03dc651 --- /dev/null +++ b/.templates/default/issue-note.sbn @@ -0,0 +1,6 @@ +{{ + if issue_label == "Bug" || issue_label == "Bug Fix" || issue_label == "Bug Fixes" +}}- Fix - {{ issue.title }} - see [#{{ issue.public_number }}]({{ issue.html_url }}). +{{ else +}}- {{ issue.title }} - see [#{{ issue.public_number }}]({{ issue.html_url }}). +{{ end -}} diff --git a/.templates/default/issues.sbn b/.templates/default/issues.sbn new file mode 100644 index 0000000..33e5201 --- /dev/null +++ b/.templates/default/issues.sbn @@ -0,0 +1,4 @@ + +{{ for issue_label in issue_labels + include 'issue-details' +end }} diff --git a/.templates/default/milestone.sbn b/.templates/default/milestone.sbn new file mode 100644 index 0000000..a3349b2 --- /dev/null +++ b/.templates/default/milestone.sbn @@ -0,0 +1,2 @@ + +{{ milestone.target.description }} diff --git a/.templates/default/release-info.sbn b/.templates/default/release-info.sbn new file mode 100644 index 0000000..2b495d2 --- /dev/null +++ b/.templates/default/release-info.sbn @@ -0,0 +1,10 @@ +{{ + if issues.count > 0 + if commits.count > 0 +}}As part of this release we had [{{ commits.count }} {{ commits.count | string.pluralize "commit" "commits" }}]({{ commits.html_url }}) which resulted in [{{ issues.count }} {{ issues.count | string.pluralize "issue" "issues" }}]({{ milestone.target.html_url }}?{{ milestone.query_string }}) being closed. +{{ else +}}As part of this release we had [{{ issues.count }} {{ issues.count | string.pluralize "issue" "issues" }}]({{ milestone.target.html_url }}?{{ milestone.query_string }}) closed. +{{ end + else if commits.count > 0 +}}As part of this release we had [{{ commits.count }} {{ commits.count | string.pluralize "commit" "commits" }}]({{ commits.html_url }}). +{{ end -}}