Skip to content

Commit 3a8595d

Browse files
committed
.github/workflows/test-igor-rebase-exec-workflow.yml: Fix it for the release branch
In c3e7dc3 (.github/workflows: Add job to compile test each commit, 2023-12-22) we introduced a compilation test of each commit in the branch. But we assumed that the base branch, the branch we want to merge into, is origin/main. This is not true for the release branches. As there is no way to gather the base branch for on.push workflows [1] we added some code to get the release branch with the highest version and then check if we are an ancestor of that or origin/main. [1]: https://github.com/orgs/community/discussions/26243#discussioncomment-3250924
1 parent 1dbc84b commit 3a8595d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎.github/workflows/test-igor-rebase-exec-workflow.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,23 @@ jobs:
7878
ref: ${{ github.sha }}
7979
- name: Initial repo config
8080
run: tools/initial-repo-config.sh
81+
- name: Get latest release branch
82+
run: |
83+
CI_RELEASE_BRANCH=$(git branch --sort="version:refname" -rl "origin/release*" | tail -n1)
84+
echo "CI_RELEASE_BRANCH=$CI_RELEASE_BRANCH" >> $GITHUB_ENV
85+
- name: Gather base branch
86+
run: |
87+
CI_BASE_BRANCH=$((git merge-base --is-ancestor ${{ env.release_branch }} HEAD && echo "${{ env.release_branch }}") || echo "origin/main")
88+
echo "CI_BASE_BRANCH=$CI_BASE_BRANCH" >> $GITHUB_ENV
8189
- name: List of commits to operate on
82-
run: git log --pretty=ref origin/main..
90+
run: git log --pretty=ref ${{ env.CI_BASE_BRANCH }}..
8391
- name: Cleanup earlier rebase invocations
8492
run: git rebase --quit 2>/dev/null || true
8593
- name: Compile check each commit with ${{ inputs.experiment }}
8694
run: |
8795
git rebase --exec "git log --pretty=ref -n1" \
8896
--exec "tools/clean_mies_installation.sh ${{ inputs.installer_flags }}" \
89-
--exec "tools/autorun-test.sh -p ${{ inputs.experiment }} -v IP_9_64" origin/main
97+
--exec "tools/autorun-test.sh -p ${{ inputs.experiment }} -v IP_9_64" ${{ env.CI_BASE_BRANCH }}
9098
- name: Gather log files and crash dumps
9199
if: always()
92100
run: tools/gather-logfiles-and-crashdumps.sh

0 commit comments

Comments
 (0)