1919 # This fetches only a single branch by default, so additional fetch is needed
2020 fetch-depth : 0 # Optionally, set to 0 to fetch all history for all branches and tags
2121
22- - name : Determine current branch or PR ref
23- id : get_branch
24- run : |
25- if [[ "${{ github.event_name }}" == "pull_request" ]]; then
26- # Extract the base branch of the PR
27- BRANCH_NAME="${{ github.event.pull_request.base.ref }}"
28- echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
29- else
30- # Assume it's a push event, extract the branch name from $GITHUB_REF
31- BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')
32- echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
33- fi
34- # Now echoing the BRANCH_NAME to verify
35- echo "BRANCH_NAME: $BRANCH_NAME"
36- shell : bash
37- env :
38- GITHUB_REF : ${{ github.ref }}
39-
4022 - name : Initialize and update submodule
4123 run : |
4224 git submodule update --init --recursive
@@ -53,23 +35,23 @@ jobs:
5335 NOTEBOOKS_CURRENT_COMMIT=$(git rev-parse HEAD)
5436 echo $(git fetch --all --verbose)
5537 echo $(git remote get-url origin)
56- if git show-ref --verify refs/remotes/origin/$BRANCH_NAME ; then
57- echo "Branch $BRANCH_NAME exists."
38+ if git show-ref --verify refs/remotes/origin/develop ; then
39+ echo "Branch develop exists."
5840 else
59- echo "::error::Branch $BRANCH_NAME does not exist on remote."
41+ echo "::error::Branch develop does not exist on remote."
6042 exit 1
6143 fi
62- NOTEBOOKS_LATEST_COMMIT=$(git rev-parse refs/remotes/origin/${{ env.BRANCH_NAME }} )
44+ NOTEBOOKS_LATEST_COMMIT=$(git rev-parse refs/remotes/origin/develop )
6345 echo "NOTEBOOKS_LATEST_COMMIT: $NOTEBOOKS_LATEST_COMMIT"
6446 echo "NOTEBOOKS_CURRENT_COMMIT: $NOTEBOOKS_CURRENT_COMMIT"
6547
6648
6749 cd ../..
6850 if [ "$NOTEBOOKS_LATEST_COMMIT" != "$NOTEBOOKS_CURRENT_COMMIT" ]; then
69- echo "::error ::Submodule $NOTEBOOKS_PATH is not up to date with the ${{ env.BRANCH_NAME }} branch. Please update it."
51+ echo "::error ::Submodule $NOTEBOOKS_PATH is not up to date with the develop branch. Please update it."
7052 exit 1
7153 else
72- echo "Submodule $NOTEBOOKS_PATH is up to date with the ${{ env.BRANCH_NAME }} branch."
54+ echo "Submodule $NOTEBOOKS_PATH is up to date with the develop branch."
7355 fi
7456
7557 # Checking FAQs only on the develop branch.
0 commit comments