Skip to content

Commit 95f81fe

Browse files
committed
ci(pr_test_build_images): git diff against base ref
1 parent d69c6a2 commit 95f81fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/pr_test_build_images.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
# For now, we run on all paths, but if the products could be moved into a subdirectory, we could match on that
99
# paths: []
1010

11+
env:
12+
GIT_BASE_REF: ${{ github.event.pull_request.base.sha }}
13+
GIT_HEAD_REF: ${{ github.event.pull_request.head.sha }}
14+
1115
jobs:
1216
# The set of paths for changed files (eg: airflow/Dockerfile, zookeeper/stackable/jmx/server.yaml)
1317
# ... limited to the product-paths (eg: airflow, zookeeper) that have a versions.py
@@ -17,6 +21,8 @@ jobs:
1721
runs-on: ubuntu-latest
1822
steps:
1923
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
24+
with:
25+
fetch-depth: 0
2026
- id: shard
2127
shell: bash
2228
env:
@@ -27,7 +33,7 @@ jobs:
2733
2834
PRODUCT_VERSION_PAIRS=$(
2935
# shellcheck disable=SC2016
30-
git diff --name-only \
36+
git diff --name-only "${GIT_BASE_REF}..${GIT_HEAD_REF}" \
3137
| cut --delimiter=/ --fields=1 | xargs -I {} find {} -type f -maxdepth 1 -name versions.toml \
3238
| xargs -r dirname \
3339
| xargs -I {} tomlq --raw-output --arg product "{}" '{$product: .versions | map_values(select(.build_on_pr)) | keys[]}' {}/versions.toml \

0 commit comments

Comments
 (0)