From 86e38b62b300aff0f6a8e935dab8c91f6eccb7cd Mon Sep 17 00:00:00 2001
From: Dev Ojha <ValarDragon@users.noreply.github.com>
Date: Tue, 23 Mar 2021 12:36:45 -0500
Subject: [PATCH] Add files from template into repo (#73)

---
 .github/ISSUE_TEMPLATE/bug_report.md      | 25 ++++++++++++++++
 .github/ISSUE_TEMPLATE/feature_request.md | 35 +++++++++++++++++++++++
 .github/PULL_REQUEST_TEMPLATE.md          | 26 +++++++++++++++++
 .github/workflows/linkify_changelog.yml   | 20 +++++++++++++
 CHANGELOG.md                              |  9 ++++++
 scripts/linkify_changelog.py              | 31 ++++++++++++++++++++
 6 files changed, 146 insertions(+)
 create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md
 create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md
 create mode 100644 .github/PULL_REQUEST_TEMPLATE.md
 create mode 100644 .github/workflows/linkify_changelog.yml
 create mode 100644 CHANGELOG.md
 create mode 100644 scripts/linkify_changelog.py

diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..e01ca94
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,25 @@
+---
+name: Bug Report 
+about: Create a report to help us squash bugs!
+
+---
+
+<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ 
+v                            ✰  Thanks for opening an issue! ✰    
+v    Before smashing the submit button please review the template.
+v    Please also ensure that this is not a duplicate issue :)  
+☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->∂
+
+## Summary of Bug
+
+<!-- Concisely describe the issue -->
+
+## Version
+
+<!-- git commit hash or tagged version -->
+
+## Steps to Reproduce
+
+<!-- Also please note what feature flags the library was compiled with? -->
+<!-- If this is a build issue, also indicate your OS and compiler versions (clang --version) -->
+
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..7d5ed5d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,35 @@
+---
+name: Feature Request
+about: Create a proposal to request a feature
+
+---
+
+<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ 
+v                            ✰  Thanks for opening an issue! ✰    
+v    Before smashing the submit button please review the template.
+v    Word of caution: poorly thought-out proposals may be rejected 
+v                     without deliberation 
+☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->
+
+## Summary
+
+<!-- Short, concise description of the proposed feature -->
+
+## Problem Definition
+
+<!-- Why do we need this feature? 
+What problems may be addressed by introducing this feature?
+Are there any disadvantages of including this feature? -->
+
+## Proposal
+
+<!-- Detailed description of requirements of implementation -->
+
+____
+
+#### For Admin Use
+
+- [ ] Not duplicate issue
+- [ ] Appropriate labels applied
+- [ ] Appropriate contributors tagged
+- [ ] Contributor assigned/self-assigned
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..37f2f6c
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,26 @@
+<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
+v                               ✰  Thanks for creating a PR! ✰
+v    Before hitting that submit button please review the checkboxes.
+v    If a checkbox is n/a - please still include it but + a little note why
+☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->
+
+## Description
+
+<!-- Add a description of the changes that this PR introduces and the files that
+are the most critical to review.
+-->
+
+closes: #XXXX
+
+---
+
+Before we can merge this PR, please make sure that all the following items have been
+checked off. If any of the checklist items are not applicable, please leave them but
+write a little note why.
+
+- [ ] Targeted PR against correct branch (master)
+- [ ] Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
+- [ ] Wrote unit tests
+- [ ] Updated relevant documentation in the code
+- [ ] Added a relevant changelog entry to the `Pending` section in `CHANGELOG.md`
+- [ ] Re-reviewed `Files changed` in the Github PR explorer
diff --git a/.github/workflows/linkify_changelog.yml b/.github/workflows/linkify_changelog.yml
new file mode 100644
index 0000000..0cbe85f
--- /dev/null
+++ b/.github/workflows/linkify_changelog.yml
@@ -0,0 +1,20 @@
+name: Linkify Changelog
+
+on:
+  workflow_dispatch
+
+jobs:
+  linkify:
+    runs-on: ubuntu-latest
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v2
+    - name: Add links
+      run: python3 scripts/linkify_changelog.py CHANGELOG.md
+    - name: Commit
+      run: |
+          git config user.name github-actions
+          git config user.email github-actions@github.com
+          git add .
+          git commit -m "Linkify Changelog"
+          git push
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..5ef9c79
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,9 @@
+## Pending
+
+### Breaking changes
+
+### Features
+
+### Improvements
+
+### Bug fixes
diff --git a/scripts/linkify_changelog.py b/scripts/linkify_changelog.py
new file mode 100644
index 0000000..867ae14
--- /dev/null
+++ b/scripts/linkify_changelog.py
@@ -0,0 +1,31 @@
+import re
+import sys
+import fileinput
+import os
+
+# Set this to the name of the repo, if you don't want it to be read from the filesystem.
+# It assumes the changelog file is in the root of the repo.
+repo_name = ""
+
+# This script goes through the provided file, and replaces any " \#<number>",
+# with the valid mark down formatted link to it. e.g.
+# " [\#number](https://github.com/arkworks-rs/template/pull/<number>)
+# Note that if the number is for a an issue, github will auto-redirect you when you click the link.
+# It is safe to run the script multiple times in succession. 
+#
+# Example usage $ python3 linkify_changelog.py ../CHANGELOG.md
+if len(sys.argv) < 2:
+    print("Must include path to changelog as the first argument to the script")
+    print("Example Usage: python3 linkify_changelog.py ../CHANGELOG.md")
+    exit()
+
+changelog_path = sys.argv[1]
+if repo_name == "":
+    path = os.path.abspath(changelog_path)
+    components = path.split(os.path.sep)
+    repo_name = components[-2]
+
+for line in fileinput.input(inplace=True):
+    line = re.sub(r"\- #([0-9]*)", r"- [\\#\1](https://github.com/arkworks-rs/" + repo_name + r"/pull/\1)", line.rstrip())
+    # edits the current file
+    print(line)
\ No newline at end of file
-- 
GitLab