Skip to content
on:
push:
branches:
- 'workflows/gh-action-merge-release-changes-into-main'
env:
starting_branch: ${{ github.ref }}
working_branch: workflows/merge-release-changes-to-main
base_branch: main
permissions:
contents: write
issues: write
pull-requests: write
jobs:
check_out:
runs-on: ubuntu-latest
if: ${{ github.repository }} == 'hemlholtz-analytics/heat'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: '${{ env.starting_branch }}'
- name: Delete working branch if it already exists
run: git push --delete origin ${{ env.working_branch }} || true
- name: Create working branch
run: |
git checkout -b ${{ env.working_branch }}
git push --set-upstream origin ${{ env.working_branch }}
- name: Create a pull request
uses: peter-evans/create-pull-request@v4
with:
delete-branch: true
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Merge release changes to main'
title: 'Merge ${{ env.starting_branch }} changes to ${{ env.base_branch }}'
body: 'This PR merges changes from release branch to main branch'
branch: '${{ env.working_branch }}'
base: '${{ env.base_branch }}'