Skip to content

Commit

Permalink
feat(workflows): add logic to check and create/checkout feature branc…
Browse files Browse the repository at this point in the history
…h for Liquibase version
  • Loading branch information
jandroav committed Mar 5, 2024
1 parent 3bfeabb commit f99d541
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Check if feature branch for ${{ inputs.liquibase-version }} exists
id: branch_check
run: |
BRANCH_EXISTS=$(git ls-remote --heads origin feature/protobuf-${{ inputs.liquibase-version }} | wc -l)
echo "::set-output name=branch_exists::$BRANCH_EXISTS"
- name: Create or checkout branch for ${{ inputs.liquibase-version }}
run: |
if [ ${{ steps.branch_check.outputs.branch_exists }} -eq 0 ]; then
git checkout -b feature/protobuf-${{ inputs.liquibase-version }}
git push origin feature/protobuf-${{ inputs.liquibase-version }}
else
git checkout feature/protobuf-${{ inputs.liquibase-version }}
git pull origin feature/protobuf-${{ inputs.liquibase-version }}
fi
- name: Create feature branch
run: |
git checkout -b "feature/protobuf-${{ inputs.liquibase-version }}"
Expand Down

0 comments on commit f99d541

Please sign in to comment.