Skip to content

Commit c8a3975

Browse files
committed
Rely on "git log" to pick the latest commit that has changes in relevant packages
1 parent 96c7c4f commit c8a3975

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

.github/workflows/ensure_sync_service_image.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
tag:
7-
required: true
7+
required: false
88
type: string
99
outputs:
1010
image:
@@ -45,6 +45,13 @@ jobs:
4545
username: ${{ github.actor }}
4646
password: ${{ secrets.GITHUB_TOKEN }}
4747

48+
- name: Get the latest commit SHA that has touched files in either packages/electric-telemetry or packages/sync-service
49+
if: ${{ if !env.TAG }}
50+
run: |
51+
echo "TAG=$(
52+
git log -1 --format='%H' -- electric-telemetry/ sync-service/{config, lib, rel, mix.*, package.json}
53+
)" >> $GITHUB_ENV
54+
4855
- name: Check if image tag already exists
4956
id: exists
5057
run: |

.github/workflows/ts_tests.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,8 @@ jobs:
6060
- run: pnpm -r --filter "$(jq '.name' -r package.json)^..." build
6161
- run: pnpm run typecheck
6262

63-
image_tag:
64-
name: Derive the image tag for sync-service from the package source code
65-
runs-on: ubuntu-latest
66-
outputs:
67-
tag: ${{ steps.hash.outputs.tag }}
68-
steps:
69-
- uses: actions/checkout@v4
70-
- run: |
71-
echo "tag=${{ hashFiles('packages/sync-service/mix.lock', 'packages/electric-telemetry/mix.lock') }}" >> $GITHUB_OUTPUT
72-
id: hash
73-
7463
ensure_sync_service_image:
75-
needs: image_tag
7664
uses: ./.github/workflows/ensure_sync_service_image.yml
77-
with:
78-
tag: ${{ needs.image_tag.outputs.tag }}
7965

8066
build_and_test_packages:
8167
name: 'Test ${{ matrix.package_dir }} w/ sync-service'

0 commit comments

Comments
 (0)