Skip to content

Commit

Permalink
Generated recursive chat gpt workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mbuchoff committed Jul 24, 2024
1 parent 1393a6c commit 4c83832
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/chatgpt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Recursive Merge

on:
push:
branches:
- release/3
- release/2

jobs:
merge:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Merge branch
id: merge
run: |
BRANCH=$(echo "${{ github.ref }}" | sed 's/refs\/heads\///')
echo "Current branch: $BRANCH"
if [[ "$BRANCH" == "release/3" ]]; then
TARGET_BRANCH="release/2"
elif [[ "$BRANCH" == "release/2" ]]; then
TARGET_BRANCH="release/1"
else
echo "Branch $BRANCH is not configured for recursive merging"
exit 1
fi
git fetch origin $TARGET_BRANCH
git checkout $TARGET_BRANCH
git merge --no-ff --no-edit $BRANCH
git push origin $TARGET_BRANCH
- name: Check if merge was successful
if: steps.merge.outcome == 'success'
run: echo "Merge to $TARGET_BRANCH was successful"

0 comments on commit 4c83832

Please sign in to comment.