-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (23 loc) · 941 Bytes
/
createPR.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
name: Create a pull request for release.
on:
push:
branches: [ develop ]
jobs:
create-release-pr:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Check if pr exists
id: check_pr
run: |
pr_title=${{ (github.ref == 'refs/heads/develop' && 'Develop') || '' }}
base_branch=${{ (github.ref == 'refs/heads/develop' && 'main') || 'develop' }}
echo "::set-output name=count::$(gh pr list -S ${pr_title}' in:title' -B $base_branch | wc -l)"
echo "::set-output name=pr_title::$pr_title"
echo "::set-output name=base_branch::$base_branch"
- name: Create release pr
if: ${{ steps.check_pr.outputs.count == 0 }}
run: |
gh pr create -B ${{ steps.check_pr.outputs.base_branch }} -t ${{ steps.check_pr.outputs.pr_title }} -b "Automatically generated PR."