-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 1.1 KB
/
convert_issue_to_PR.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
name: Forward request to PR
on:
issues:
types: [labeled]
jobs:
createPullRequest:
if: github.event.label.name == 'data request'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Create new branch and commit
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git checkout -b issue-${{ github.event.issue.number }}/request
echo "${{ github.event.issue.number }}" > issue.txt
git add issue.txt
git commit -m "Add file for issue #${{ github.event.issue.number }}"
git push origin issue-${{ github.event.issue.number }}/request
- name: Add 'submitted' label to issue
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['submitted']
})