diff --git a/.github/workflows/new_stable_version.yml b/.github/workflows/new_stable_version_manual.yml similarity index 93% rename from .github/workflows/new_stable_version.yml rename to .github/workflows/new_stable_version_manual.yml index 452828e..edb205d 100644 --- a/.github/workflows/new_stable_version.yml +++ b/.github/workflows/new_stable_version_manual.yml @@ -1,4 +1,4 @@ -name: Create New Stable Version +name: Create New Stable Version (Manual) on: workflow_dispatch: diff --git a/.github/workflows/new_stable_version_push.yml b/.github/workflows/new_stable_version_push.yml new file mode 100644 index 0000000..dcd9331 --- /dev/null +++ b/.github/workflows/new_stable_version_push.yml @@ -0,0 +1,27 @@ +name: Create New Stable Version (Push) + +on: + push: + branches: + - main + +jobs: + create_pull_request: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Check commit message for [stable] + id: check_commit_message + run: echo ::set-output name=contains_stable::$(if grep -q "\[stable\]" <<< "$(git log --format=%B -n 1)"; then echo true; else echo false; fi) + + - name: Create Pull Request + if: steps.check_commit_message.outputs.contains_stable == 'true' + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: stable + base: main + title: Automated New Stable Version + body: This pull request was automatically created by the workflow and contains the latest stable version of the repository.