-
Notifications
You must be signed in to change notification settings - Fork 34
42 lines (35 loc) · 1.11 KB
/
add-from-issue.yml
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
name: add-from-issue
on:
issues:
types: [labeled]
jobs:
add-item:
if: github.event.label.name == 'new addition'
permissions:
contents: write # 'write' access to repository contents
pull-requests: write # 'write' access to pull requests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20"
cache: npm
- name: Install
run: npm ci
- name: Add from body of issue
run: npm run add-from-issue $'${{ github.event.issue.body }}'
- name: Format
run: npm run format
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Added from issue ${{github.event.issue.number}}"
branch: add-from-issue/${{github.event.issue.number}}
title: "Pull request for '${{github.event.issue.title}}'"
body: "Closes #${{github.event.issue.number}}"