Skip to content

Commit c7cda1a

Browse files
parth-07quic-seaswara
authored andcommitted
Use correct base branch for checking non-doc changes in PR CI
This commit fixes the pull-request CI workflow to use the correct base branch when checking for non-doc changes in pull-request CI. Until now, if a pull-request was created for qualcomm/eld/release/23.x branch using parth/eld/SomeFeature branch, then the 'Check for non-doc changes' step in pull-request CI will take parth/eld/SomeFeature branch as the HEAD commit and parth/eld/release/23.x branch as the base. The base used here is wrong and should instead be qualcomm/eld/release/23.x. Using incorrect base has two key issues: - If the repository of the branch using which PR is created does not have a branch named as the ${BASE_BRANCH} then the `git diff ...` command will error out and the workflow will fail. - A more serious issue is that the PR author can update his/her ${REPO}/eld/${BASE_BRANCH} such that the 'check for non-doc changes' returns no diff and the workflow incorrectly passes without building/running tests. Signed-off-by: Parth Arora <partaror@qti.qualcomm.com>
1 parent d40c864 commit c7cda1a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ jobs:
7878
id: file-check
7979
working-directory: pr-${{ env.PR_NUMBER }}/llvm-project/llvm/tools/eld
8080
run: |
81-
git fetch origin "${BASE_BRANCH_NAME}"
82-
MERGE_BASE=$(git merge-base "origin/${BASE_BRANCH_NAME}" HEAD)
81+
# We need to use base branch from qualcomm/eld
82+
git remote add QC https://github.com/qualcomm/eld.git
83+
git fetch QC ${{ env.BASE_BRANCH_NAME }} --depth=1
84+
MERGE_BASE=$(git merge-base QC/${{ env.BASE_BRANCH_NAME }} HEAD)
8385
CHANGED_FILES=$(git diff --name-only "$MERGE_BASE" HEAD)
8486
echo "Changed files: $CHANGED_FILES"
8587
for file in $CHANGED_FILES; do

0 commit comments

Comments
 (0)