Skip to content

Commit

Permalink
fix: add changeset semvar value check (#12947)
Browse files Browse the repository at this point in the history
* fix: add changeset semvar value check

* add #internal tag
  • Loading branch information
momentmaker authored Apr 24, 2024
1 parent 0f23216 commit 758ffd6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-kangaroos-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Add check for valid semvar value for changeset file #internal
8 changes: 8 additions & 0 deletions .github/scripts/check-changeset-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ if [[ ! -f "$CHANGESET_FILE_PATH" ]]; then
exit 1
fi

changeset_content=$(sed -n '/^---$/,/^---$/{ /^---$/!p; }' $CHANGESET_FILE_PATH)
semvar_value=$(echo "$changeset_content" | awk -F": " '/"chainlink"/ {print $2}')

if [[ "$semvar_value" != "major" && "$semvar_value" != "minor" && "$semvar_value" != "patch" ]]; then
echo "Invalid changeset semvar value for 'chainlink'. Must be 'major', 'minor', or 'patch'."
exit 1
fi

while IFS= read -r line; do
for tag in "${tags_list[@]}"; do
if [[ "$line" == *"$tag"* ]]; then
Expand Down

0 comments on commit 758ffd6

Please sign in to comment.