Skip to content

Commit

Permalink
Add pull request template
Browse files Browse the repository at this point in the history
  • Loading branch information
xpaczka committed Dec 1, 2023
1 parent becb0fa commit 4e418f0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions .github/workflows/create-pr-template.yml
Original file line number Diff line number Diff line change
@@ -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
});

0 comments on commit 4e418f0

Please sign in to comment.