From a9e4b5662c4e7ca22be3a26b88552723951969c0 Mon Sep 17 00:00:00 2001 From: Parteek Goyal Date: Tue, 27 Jun 2023 22:31:25 +0530 Subject: [PATCH 1/2] workflow to create Pull request --- .github/workflows/pull_request.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..511a37a --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,31 @@ +name: Automatic Pull request + +on: + workflow_dispatch: + inputs: + title: + description: 'title of example' + required: true + body: + description: 'description of example' + required: true + upstreamRepo: + description: 'Upstream repo' + required: true + botRepo: + description: 'bot repo' + required: true + repo: + description: 'repo name' + required: true + +jobs: + create-pull-request: + runs-on: ubuntu-latest + + steps: + - name: Create PR + run: | + gh pr create --repo ${{ github.event.inputs.upstreamRepo }}/${{ github.event.inputs.repo }} --head ${{ github.event.inputs.botRepo }}:${{ github.ref }} --base main --title "${{ github.event.inputs.title }}" --body "${{ github.event.inputs.body }}" + env: + GITHUB_TOKEN: ${{ secrets.token }} From fdf83cd4c1b25d7e91d966b66575a7c40c454902 Mon Sep 17 00:00:00 2001 From: Parteek Goyal Date: Tue, 27 Jun 2023 22:40:18 +0530 Subject: [PATCH 2/2] Update pull_request.yml --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 511a37a..ff3c02a 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -26,6 +26,6 @@ jobs: steps: - name: Create PR run: | - gh pr create --repo ${{ github.event.inputs.upstreamRepo }}/${{ github.event.inputs.repo }} --head ${{ github.event.inputs.botRepo }}:${{ github.ref }} --base main --title "${{ github.event.inputs.title }}" --body "${{ github.event.inputs.body }}" + gh pr create --repo ${{ github.event.inputs.botRepo }}/${{ github.event.inputs.repo }} --head ${{ github.ref }} --base ${{ github.event.inputs.upstreamRepo }}:main --title "${{ github.event.inputs.title }}" --body "${{ github.event.inputs.body }}" env: GITHUB_TOKEN: ${{ secrets.token }}