Skip to content

Commit

Permalink
get develop branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Aug 14, 2024
1 parent 64a6421 commit 23933ab
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/build_commit_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,30 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

- name: Checkout the same branch for teddycloud_web
run: |
# Get the current branch of the parent project
PARENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Checkout the same branch in the submodule
# Navigate into the submodule directory
cd teddycloud_web
git checkout $PARENT_BRANCH || git checkout -b $PARENT_BRANCH
cd ..
- name: Update teddycloud_web submodule
run: git submodule update --remote teddycloud_web
# Fetch all branches from the remote in case it's not already available
git fetch origin
# Check if the branch exists locally or on the remote
if git show-ref --verify --quiet refs/heads/$PARENT_BRANCH; then
git checkout $PARENT_BRANCH
elif git show-ref --verify --quiet refs/remotes/origin/$PARENT_BRANCH; then
git checkout $PARENT_BRANCH
else
echo "Branch '$PARENT_BRANCH' does not exist in the submodule. Exiting."
exit 1
fi
# Navigate back to the parent directory
cd ..
- name: Git status
run: |
Expand Down

0 comments on commit 23933ab

Please sign in to comment.