Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #3

Merged
merged 23 commits into from
Oct 25, 2023
33 changes: 33 additions & 0 deletions .github/workflows/auto-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Auto PR

on:
push:
branches:
- 'release/*'

jobs:
auto-pr:
runs-on: ubuntu-latest

env:
GH_TOKEN: ${{ github.token }}

steps:
- uses: actions/checkout@v3

- name: Create Pull Request to the next higher release

run: |
set -x
git fetch
RELEASE_VERSIONS=$(git branch -r | grep 'release/' | cut -d '/' -f 3 | sort -V)
CURRENT_VERSION=$(echo $GITHUB_REF | rev | cut -d '/' -f 1 | rev)
ME_AND_MY_NEXT=$(echo "$RELEASE_VERSIONS" | grep -w $CURRENT_VERSION -A 1)
NUM=$(echo "$ME_AND_MY_NEXT" | wc -l)
echo $NUM
echo "$ME_AND_MY_NEXT"
echo "$RELEASE_VERSIONS"
if (( NUM > 1 )); then
NEXT_VERSION=$(echo "$ME_AND_MY_NEXT" | tail -n 1)
gh pr create -B "release/$NEXT_VERSION" -H "release/$CURRENT_VERSION" --title 'Merge' --body 'Created by Github action'
fi