-
Notifications
You must be signed in to change notification settings - Fork 71
55 lines (47 loc) · 1.78 KB
/
cpr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Create Pull Request
on:
issues:
types: [opened]
jobs:
createPullRequest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Env Vars
env:
ISSUE_BODY: ${{ github.event.issue.body }}
run: |
echo CHAIN_PATH=chains/$(echo "$ISSUE_BODY" | gawk '/^(mainnet|testnet)/{printf $1;exit}') >> $GITHUB_ENV
echo FILE_NAME=$(echo "$ISSUE_BODY" | gawk '/^[^#]/{printf $1;exit}') >> $GITHUB_ENV
echo "FILE_CONTENT<<EOF" >> $GITHUB_ENV
echo "$ISSUE_BODY" | gawk '/^module.exports/,/^}/' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Join File Path
env:
CHAIN_PATH: ${{ env.CHAIN_PATH }}
FILE_NAME: ${{ env.FILE_NAME }}
run: echo FILE_PATH=$CHAIN_PATH/$FILE_NAME.js | tr -d "\r" >> $GITHUB_ENV
- name: Create file
run: |
echo "${{ env.FILE_CONTENT }}" > ${{ env.FILE_PATH }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
commit-message: Add
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: ${{ github.event_name}}/${{ github.event.action }}-${{ github.event.issue.number }}
delete-branch: true
title: ${{ github.event_name}}/${{ github.event.action }}-${{ github.event.issue.number }}
body: |
Update report
- Updated with *today's* date
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: |
automated pr
reviewers: |
Jared-TFL
draft: false