-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 1.2 KB
/
create-pr-when-get-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
name: Extract Issue Content And Create PR Request
on:
issues:
types: [opened]
jobs:
extract-issue-content-and-echo:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create new branch and commit changes
run: |
git config --global user.name 'auto-create-pr'
git config --global user.email 'github-actions@github.com'
git checkout -b new-branch-${{ github.event.issue.number }}
echo "${{ github.event.issue.body }}" > newfile.txt
git add newfile.txt
git commit -m "Add new file"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: new-branch-${{ github.event.issue.number }}
- name: Create PR
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Create PR'
title: 'Create PR'
body: |
This PR was auto-created from Issue #${{ github.event.issue.number }}. The original issue content was: "${{ github.event.issue.body }}"
branch: 'main'