From 4e418f0d6a19af95d500d32dd9cd4c2b6ad89f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Paczy=C5=84ski?= Date: Fri, 1 Dec 2023 15:51:56 +0100 Subject: [PATCH 1/5] Add pull request template --- .github/pull_request_template.md | 36 ++++++++++++++++++++++++ .github/workflows/create-pr-template.yml | 33 ++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/create-pr-template.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..d5be499e9 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,36 @@ +## Issues connected + +Please provide a list of issues connected to this PR (resolves / closes or ref if not closing the selected issue) + +## Description + +Please include a summary of the changes + +## Pull request type + +- [ ] Bug fix +- [ ] New feature +- [ ] Code refactoring / code cleanup +- [ ] Other + +If type is "other" make sure to explicitly define the solved problem in the PR description + +## Screenshots / images / videos + +Please provide assets necessary for the PR (remove if not applicable) + +## What has been done + +Please provide a list of changes that were done (functions, components, JSONs, etc.) + +- Change 1 +- Change 2 +- Change 3 + +## Testing + +Please provide a testing checklist + +- [ ] Test 1 +- [ ] Test 2 +- [ ] Test 3 diff --git a/.github/workflows/create-pr-template.yml b/.github/workflows/create-pr-template.yml new file mode 100644 index 000000000..19072a3f0 --- /dev/null +++ b/.github/workflows/create-pr-template.yml @@ -0,0 +1,33 @@ +# This workflow creates an universal and cofigurable template for all dapp pull requests +name: Apply PR Template + +on: + pull_request: + types: + - opened + branches: main + +jobs: + create_pr_template: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set PR Body + run: | + TEMPLATE=$(<.github/pull_request_template.md) + PR_BODY=$(echo "TEMPLATE" | sed -e 's/^/ /') + jq -n --arg body "$PR_BODY" '{body: $body}' > pr_body.json + - name: Apply PR Body + uses: actions/github-script@v6 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const fs = require('fs'); + const prBody = JSON.parse(fs.readFileSync('pr_body.json', 'utf8')); + github.pulls.update({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number, + body: prBody.body + }); From 996db8d5b6bda192f62b0b624f2ee1b87ad8610d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Paczy=C5=84ski?= Date: Fri, 1 Dec 2023 16:11:07 +0100 Subject: [PATCH 2/5] Fix workflow `run` script --- .github/workflows/create-pr-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-pr-template.yml b/.github/workflows/create-pr-template.yml index 19072a3f0..1dee342eb 100644 --- a/.github/workflows/create-pr-template.yml +++ b/.github/workflows/create-pr-template.yml @@ -17,7 +17,7 @@ jobs: run: | TEMPLATE=$(<.github/pull_request_template.md) PR_BODY=$(echo "TEMPLATE" | sed -e 's/^/ /') - jq -n --arg body "$PR_BODY" '{body: $body}' > pr_body.json + echo "{\"body\": \"$PR_BODY\"}" > pr_body.json - name: Apply PR Body uses: actions/github-script@v6 with: From 0e26e212905ce35be2f078a27190463349c22d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Paczy=C5=84ski?= Date: Mon, 4 Dec 2023 12:27:07 +0100 Subject: [PATCH 3/5] Update template and remove workflow --- .github/pull_request_template.md | 1 + .github/workflows/create-pr-template.yml | 33 ------------------------ 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 .github/workflows/create-pr-template.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index d5be499e9..6c9f35977 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,6 +11,7 @@ Please include a summary of the changes - [ ] Bug fix - [ ] New feature - [ ] Code refactoring / code cleanup +- [ ] DevOps - [ ] Other If type is "other" make sure to explicitly define the solved problem in the PR description diff --git a/.github/workflows/create-pr-template.yml b/.github/workflows/create-pr-template.yml deleted file mode 100644 index 1dee342eb..000000000 --- a/.github/workflows/create-pr-template.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This workflow creates an universal and cofigurable template for all dapp pull requests -name: Apply PR Template - -on: - pull_request: - types: - - opened - branches: main - -jobs: - create_pr_template: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Set PR Body - run: | - TEMPLATE=$(<.github/pull_request_template.md) - PR_BODY=$(echo "TEMPLATE" | sed -e 's/^/ /') - echo "{\"body\": \"$PR_BODY\"}" > pr_body.json - - name: Apply PR Body - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const fs = require('fs'); - const prBody = JSON.parse(fs.readFileSync('pr_body.json', 'utf8')); - github.pulls.update({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number, - body: prBody.body - }); From 7711526b4600f48eaa0f5d2ccd0b8509ff9aba98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Paczy=C5=84ski?= Date: Wed, 6 Dec 2023 14:06:18 +0100 Subject: [PATCH 4/5] Simplify PR template --- .github/pull_request_template.md | 34 +++++--------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6c9f35977..35112129f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,37 +1,13 @@ -## Issues connected - -Please provide a list of issues connected to this PR (resolves / closes or ref if not closing the selected issue) - -## Description - -Please include a summary of the changes - -## Pull request type - -- [ ] Bug fix -- [ ] New feature -- [ ] Code refactoring / code cleanup -- [ ] DevOps -- [ ] Other - -If type is "other" make sure to explicitly define the solved problem in the PR description - -## Screenshots / images / videos - -Please provide assets necessary for the PR (remove if not applicable) +Resolves ## What has been done -Please provide a list of changes that were done (functions, components, JSONs, etc.) - - Change 1 -- Change 2 -- Change 3 ## Testing -Please provide a testing checklist - - [ ] Test 1 -- [ ] Test 2 -- [ ] Test 3 + +## Screenshots / images / videos + +Please provide assets necessary for the PR (remove if not applicable) From 9fb43b7db8b629ec48c564d1bd94463ec92393de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Paczy=C5=84ski?= Date: Wed, 6 Dec 2023 14:07:26 +0100 Subject: [PATCH 5/5] Add header for issues resolved --- .github/pull_request_template.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 35112129f..2ff02496b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,5 @@ +## Issues connected + Resolves ## What has been done