Skip to content

Commit aee2643

Browse files
authored
Merge pull request #602 from element-hq/bbz/fix-dyff-refs
CI: change the comparision branch for the dyff job after the change to the source branch.
2 parents 6730556 + bb07a68 commit aee2643

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

.github/workflows/templates-dyff.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
generate-dyff:
1414
runs-on: ubuntu-latest
1515
steps:
16+
# This checks out the merge of the PR branch and the base branch.
17+
# If you check this to be just the PR branch then the ref for the subsequent checkout
18+
# needs to be changed too or you end up with unexpected changes being shown.
1619
- name: Checkout PR
1720
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1821
with:
@@ -35,18 +38,12 @@ jobs:
3538
done
3639
echo "output_dir=$RUNNER_TEMP/new" | tee -a "$GITHUB_OUTPUT"
3740
38-
# We want the most recent common ancestor between the target & PR branches rather than the target branch itself
39-
# There could have been more commits to the target branch since the PR branch was created and we don't want to see
40-
# those changes in the dyff, only what this branch is doing.
41-
- name: Determine most recent common ancestor of target and PR branches
42-
id: merge-base
43-
run: |
44-
echo "merge-base=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})" | tee -a "$GITHUB_OUTPUT"
45-
41+
# https://github.com/orgs/community/discussions/59677 says that github.event.pull_request.base.sha
42+
# is only calculated on creation of the PR, so we reference the target branch by ref.
4643
- name: Checkout target
4744
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
4845
with:
49-
ref: ${{ steps.merge-base.outputs.merge-base }}
46+
ref: ${{ github.event.pull_request.base.ref }}
5047

5148
- name: Generate manifests for base
5249
run: |

newsfragments/602.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CI: change the comparision branch for the dyff job after the change to the source branch.

0 commit comments

Comments
 (0)