Skip to content

Commit 6b023ad

Browse files
committed
fix check to look at difference between base branch at time of current branch creation, instead of base branch now
1 parent 7ea05ed commit 6b023ad

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/ci-build.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,34 @@ jobs:
2929
only_docs_changed: ${{ steps.filter.outputs.only_docs }}
3030
steps:
3131
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Set base ref
36+
run: echo "BASE_REF=${{ github.base_ref || 'develop' }}" >> $GITHUB_ENV
37+
38+
- name: Fetch base branch
39+
run: git fetch origin $BASE_REF
3240

3341
- name: Get changed files
3442
id: changed
3543
run: |
36-
git fetch origin ${{ github.event.before }} --depth=1
37-
git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changed.txt
44+
BASE=$(git merge-base HEAD origin/develop)
45+
echo "Merge base is $BASE"
46+
git diff --name-only $BASE HEAD > changed.txt
3847
cat changed.txt
3948
4049
- name: Check unit tests should run
4150
id: filter
4251
run: |
4352
if grep -vE '^(server/|cypress/|cypress\.config\.ts|README\.md|\.github/workflows/ci-build\.yml|renovate\.json|LICENSE|\.prettierrc|\.github/workflows/release-build\.yml|\.github/PULL_REQUEST_TEMPLATE\.md|public/robots\.txt)' changed.txt | grep .; then
4453
echo "only_docs=false" >> $GITHUB_OUTPUT
54+
echo "no change"
4555
else
4656
echo "only_docs=true" >> $GITHUB_OUTPUT
57+
echo "change"
4758
fi
59+
4860
4961
lint-and-unit-test:
5062
name: Lint & Unit Tests

0 commit comments

Comments
 (0)