Skip to content

Commit fca5a52

Browse files
authored
fix: update non major version updates (#325)
1 parent 0adafe1 commit fca5a52

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

entrypoint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,20 @@ else
4747
NEW_PATTERN="$PATTERN$NEW_TAG"
4848
fi
4949

50-
if [[ "$INPUT_ONLY_MAJOR" == "true" && "$INPUT_USE_TAG_COMMIT_HASH" != "true" ]]; then
50+
if [[ "$INPUT_ONLY_MAJOR" == "true" ]]; then
5151
NEW_MAJOR_TAG=$(echo "$NEW_TAG" | cut -d. -f1)
5252
CURRENT_MAJOR_TAG=$(echo "$CURRENT_TAG" | cut -d. -f1)
5353

5454
if [[ "$NEW_MAJOR_TAG" == "$CURRENT_MAJOR_TAG" ]]; then
55-
echo "Skipping: This will only run on major version release not '$NEW_TAG'.";
55+
if [[ "$INPUT_USE_TAG_COMMIT_HASH" == "true" ]]; then
56+
for path in $INPUT_PATHS
57+
do
58+
echo "Replacing $CURRENT_COMMIT_HASH with $NEW_COMMIT_HASH for: $path"
59+
sed -i "s|$CURRENT_PATTERN|$NEW_PATTERN|g" "$path"
60+
done
61+
else
62+
echo "Skipping: This will only run on major version release not '$NEW_TAG'.";
63+
fi
5664
cat <<EOF >> "$GITHUB_OUTPUT"
5765
new_version=$NEW_TAG
5866
old_version=$CURRENT_TAG

0 commit comments

Comments
 (0)