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 }}