Skip to content

Commit

Permalink
Better detection
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcast-db committed Jul 9, 2024
1 parent cd936fd commit 91438cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ jobs:
- name: Validate Tag
run: |
TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p')
echo "Found tag {$TAG}"
# The status code for grep will be 1 if no match, and 0 if a match.
# Store in variable to hide the actual grep result from the console output.
MATCH=$(cat .codegen/changelog_config.yml | grep "tag: \"\[$(echo $TAG)\]\"")
- name: Log failure
if: failure()
run: |
echo "Invalid or missing tag in commit message"
exit 1
if grep -q "tag: \"[$TAG]\"" .codegen/changelog_config.yml; then
echo "Invalid or missing tag in commit message."
exit 1
else
echo "Match not found. Exiting..."
fi
6 changes: 6 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if grep -q "tag: \"\[$TAG\]\"" .codegen/changelog_config.yml; then
echo "Match found."
else
echo "Match not found. Exiting..."
exit 1
fi

0 comments on commit 91438cc

Please sign in to comment.