From d17501523a1045e32e3368c51e208ad9ea6afce2 Mon Sep 17 00:00:00 2001 From: RAHenriksen Date: Mon, 4 Nov 2024 09:29:56 +0100 Subject: [PATCH] updated the submodule in installation and workflow --- .../workflows/bifrost_sp_cdiff_workflow.yml | 24 +++++++++++++++---- install.sh | 17 +++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bifrost_sp_cdiff_workflow.yml b/.github/workflows/bifrost_sp_cdiff_workflow.yml index cb2b018..0fa437c 100644 --- a/.github/workflows/bifrost_sp_cdiff_workflow.yml +++ b/.github/workflows/bifrost_sp_cdiff_workflow.yml @@ -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: | diff --git a/install.sh b/install.sh index 0ebd2d3..369695c 100755 --- a/install.sh +++ b/install.sh @@ -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 ../../