From d7e30a523f55e000a515e51b6e1c654341bed1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Fri, 24 Nov 2023 14:30:12 +0200 Subject: [PATCH] ci: add PR action --- .github/workflows/create-pr-to-main.yml | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/create-pr-to-main.yml diff --git a/.github/workflows/create-pr-to-main.yml b/.github/workflows/create-pr-to-main.yml new file mode 100644 index 00000000..94259061 --- /dev/null +++ b/.github/workflows/create-pr-to-main.yml @@ -0,0 +1,28 @@ +name: Create PR to Main + +on: + release: + types: + - published + +permissions: + pull-requests: write + contents: read + +jobs: + create-pr-to-main: + runs-on: ubuntu-latest + steps: + - name: Abort if it's not a pre-release + if: github.event.release.prerelease == false + run: exit 1 + - name: Checkout test branch + uses: actions/checkout@v3 + with: + ref: 'test' + + - name: Create Pull Request from tag branch to main + run: | + gh pr create --title "Release ${{ github.event.release.tag_name }}" --body "Release ${{ github.event.release.tag_name }}" --base main --head ${{ github.event.release.tag_name }} --repo ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}