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

Create pull request template #821

Merged
merged 5 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
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
michalinacienciala marked this conversation as resolved.
Show resolved Hide resolved
- [ ] 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
michalinacienciala marked this conversation as resolved.
Show resolved Hide resolved
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/^/ /')
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
});