diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbf1a5ae57..c9c78785bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,16 +57,17 @@ jobs: - name: Get libc version run: ldd --versio - - name: Get branch name for pull request - if: ${{ github.event_name == 'pull_request' }} - run: | - echo "GIT_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV - - - name: Get branch name for push + - name: Get branch name to match with other repos for push if: ${{ github.event_name == 'push' }} run: | - echo "GIT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV + echo "GIT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV + - name: Get branch name to match with other repos for pull_request + if: ${{ github.event_name == 'pull_request' }} + run: | + echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV + echo "DEFAULT_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV + - name: Determine branches for other repos shell: bash {0} run: | @@ -204,16 +205,17 @@ jobs: echo "RAPIDJSONDIR=$RAPIDJSONDIR" >> $GITHUB_ENV SAMNTDIR=$GITHUB_WORKSPACE/sam echo "SAMNTDIR=$SAMNTDIR" >> $GITHUB_ENV + + - name: Get branch name to match with other repos for push + if: ${{ github.event_name == 'push' }} + run: | + echo "GIT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV - - name: Get branch name for pull request + - name: Get branch name to match with other repos for pull_request if: ${{ github.event_name == 'pull_request' }} run: | - echo "GIT_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV - - - name: Get branch name for push - if: ${{ github.event_name == 'push' }} - run: | - echo "GIT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV + echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV + echo "DEFAULT_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV - name: Determine branches for other repos shell: bash {0}