From d41d52d6176a4c2df168ac6bf5d5a846af531dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Tue, 28 Nov 2023 15:31:53 +0200 Subject: [PATCH] feat: add shared PR actions --- .github/workflows/create-pr-to-main.yml | 25 +++++++++++++++++++++++ .github/workflows/sync-test-with-main.yml | 22 ++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/create-pr-to-main.yml create mode 100644 .github/workflows/sync-test-with-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 0000000..9ea9805 --- /dev/null +++ b/.github/workflows/create-pr-to-main.yml @@ -0,0 +1,25 @@ +name: Create PR to Main + +on: + workflow_call: + secrets: + GITHUB_TOKEN: + required: true + +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 test --repo ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sync-test-with-main.yml b/.github/workflows/sync-test-with-main.yml new file mode 100644 index 0000000..b005d47 --- /dev/null +++ b/.github/workflows/sync-test-with-main.yml @@ -0,0 +1,22 @@ +name: Sync test with main + +on: + workflow_call: + secrets: + GITHUB_TOKEN: + required: true + +jobs: + sync-test-with-main: + runs-on: ubuntu-latest + steps: + - name: Checkout main branch + uses: actions/checkout@v3 + with: + ref: 'main' + + - name: Create Pull Request from main to test + run: | + gh pr create --title "Sync test with main" --base test --head main --repo ${{ github.repository }} --label "sync" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}