Skip to content

Commit

Permalink
updated the submodule in installation and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RAHenriksen committed Nov 4, 2024
1 parent 543509a commit d175015
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/bifrost_sp_cdiff_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,30 @@ jobs:
- name: Update submodule
run: |
cd bifrost_sp_cdiff/cdiff_fbi
git fetch origin
# Show the current commit hash before updating
CURRENT_COMMIT=$(git rev-parse HEAD)
echo "Current commit hash of cdiff_fbi before update: $CURRENT_COMMIT"
echo "Fetching latest changes from origin"
git fetch origin --tags
echo "Switching to the main branch and pulling latest updates"
git checkout main # or the specific branch you want to track
git pull origin main # pull the latest changes
git pull origin main --tags # pull the latest changes
# print the latest commit of cdiff_fbi
# Show the new commit hash after the update
LATEST_COMMIT=$(git rev-parse HEAD)
echo "Updated cdiff_fbi to latest commit: $LATEST_COMMIT"
echo "Updated commit hash of cdiff_fbi after update: $LATEST_COMMIT"
# print the latest tag of cdiff_fbi
LATEST_TAG_COMMIT=$(git tag --sort=-creatordate --format '%(objectname)'|head -1)
LATEST_TAG=$(git tag --sort=-creatordate|head -1)
echo "Checking commit hash for the latest tag of cdiff_fbi: $LATEST_TAG_COMMIT"
echo "Checking the lastest tag of cdiff_fbi: $LATEST_TAG"
git checkout $LATEST_TAG_COMMIT
# Step 3: Set environment variables
- name: Set environment variables
run: |
Expand Down
17 changes: 13 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,22 @@ git submodule update --init --recursive
cd bifrost_sp_cdiff/cdiff_fbi || exit

# Fetch the latest changes from the remote repository
git fetch origin
git fetch origin --tags
git checkout main # or the specific branch you want to track
git pull origin main
git pull origin main --tags

# Optionally, echo the latest commit SHA
# Show the new commit hash after the update
LATEST_COMMIT=$(git rev-parse HEAD)
echo "Updated cdiff_fbi to latest commit: $LATEST_COMMIT"
echo "Updated commit hash of cdiff_fbi after update: $LATEST_COMMIT"

# print the latest tag of ecoli_fbi
LATEST_TAG_COMMIT=$(git tag --sort=-creatordate --format '%(objectname)'|head -1)
LATEST_TAG=$(git tag --sort=-creatordate|head -1)

echo "Checking commit hash for the latest tag of ecoli_fbi: $LATEST_TAG_COMMIT"
echo "Checking the lastest tag of ecoli_fbi: $LATEST_TAG"

git checkout $LATEST_TAG_COMMIT

# Navigate back to the main project directory
cd ../../
Expand Down

0 comments on commit d175015

Please sign in to comment.