Skip to content

Commit 41c8e4d

Browse files
Add logging to all dag-sync exits
1 parent e0e0e27 commit 41c8e4d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dag-sync.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,20 @@ git fetch origin
1919
# Get new commit hash *one commit ahead* of this one
2020
new=$(git rev-list --reverse --topo-order HEAD..origin/main | head -1)
2121
# If there is no new commit hash to move to, nothing has changed, quit early
22-
[ -z "$new" ] && exit
22+
if [ -z "$new" ]; then
23+
echo "No new commits, nothing has changed, nothing to do."
24+
exit
25+
fi
2326

2427
# Move ahead to this new commit
2528
git reset --hard "$new"
2629
# Verify if have /dags/ in the last commit
2730
have_dag=$(git log -p -1 "$new" --pretty=format: --name-only | grep "catalog/dags/")
2831
# If there is no files under /dags/ folder, no need to notify, quit early
29-
[ -z "$have_dag" ] && exit
32+
if [ -z "$have_dag" ]; then
33+
echo "No changes to DAGs, nothing to do."
34+
exit
35+
fi
3036

3137
# Pull out the subject from the new commit
3238
subject=$(git log -1 --format='%s')

0 commit comments

Comments
 (0)