Skip to content

Commit

Permalink
fix semver-diff-check-no-build (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrust authored Dec 23, 2024
1 parent ff6e00f commit ca17417
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ temp_dir=$(mktemp -d)
trap 'rm -rf "$temp_dir"' EXIT

# Exit early if semver-lock.json has not changed.
if ! { git diff origin/develop...HEAD --name-only; git diff --name-only; git diff --cached --name-only; } | grep -q "$SEMVER_LOCK"; then
if ! { git diff origin/op-es...HEAD --name-only; git diff --name-only; git diff --cached --name-only; } | grep -q "$SEMVER_LOCK"; then
echo "No changes detected in semver-lock.json"
exit 0
fi

# Get the upstream semver-lock.json.
if ! git show origin/develop:packages/contracts-bedrock/snapshots/semver-lock.json > "$temp_dir/upstream_semver_lock.json" 2>/dev/null; then
echo "❌ Error: Could not find semver-lock.json in the snapshots/ directory of develop branch"
if ! git show origin/op-es:packages/contracts-bedrock/snapshots/semver-lock.json > "$temp_dir/upstream_semver_lock.json" 2>/dev/null; then
echo "❌ Error: Could not find semver-lock.json in the snapshots/ directory of op-es branch"
exit 1
fi

Expand Down Expand Up @@ -80,7 +80,7 @@ for contract in $changed_contracts; do
# Extract the old and new source files.
old_source_file="$temp_dir/old_${contract##*/}"
new_source_file="$temp_dir/new_${contract##*/}"
git show origin/develop:packages/contracts-bedrock/"$contract" > "$old_source_file" 2>/dev/null || true
git show origin/op-es:packages/contracts-bedrock/"$contract" > "$old_source_file" 2>/dev/null || true
cp "$contract" "$new_source_file"

# Extract the old and new versions.
Expand Down

0 comments on commit ca17417

Please sign in to comment.