summaryrefslogtreecommitdiffstats
path: root/.github/workflows/should_deploy_sqlglotrs.sh
blob: b62589bfa1f6e77aeba2e4d18532c8593444efa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash
set -ex

CARGO_TOML_PATH="./sqlglotrs/Cargo.toml"
CARGO_TOML_MOST_RECENT_COMMIT=$(git log -1 --pretty="%H" -- $CARGO_TOML_PATH | head -1)

PREVIOUS_TAG=$(git tag --sort=-creatordate | head -n 2 | tail -n 1)
PREVIOUS_TAG_COMMIT=$(git rev-list -n 1 $PREVIOUS_TAG)

# We should only deploy sqlglotrs if Cargo.toml was modified between this tag and the previous one
git merge-base --is-ancestor $PREVIOUS_TAG_COMMIT $CARGO_TOML_MOST_RECENT_COMMIT