Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcast-db committed Jul 9, 2024
1 parent 1cc6fee commit 9f1bdfd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .codegen/changelog_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ change_types:
- message: Bug Fixes
tag: "[Fix]"
- message: Documentation
tag: "[Docs]"
tag: "[Doc]"
- message: Internal Changes
tag: "[Internal]"
# Default for messages without a tag
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ jobs:

commit-message:
runs-on: ubuntu-latest

if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate Tag
run: |
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
TAG=$(echo MSG | sed 's/\[\(.*\)\].*/\1/')
TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p')
echo "Found tag {$TAG}"
LINE=$(cat .codegen/changelog_config.yml | grep "tag: \"\[$(echo $TAG)\]\"")
VALID=$([ -z "$TAG" ] && echo "False" || echo "True")
echo "::set-env name=VALID_TAG::${TAG}"
- name: Valid Tag
if: ${{VALID}} != "true"
uses: actions/github-script@v3
with:
script: |
core.setFailed('Invalid tag name')
# 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

0 comments on commit 9f1bdfd

Please sign in to comment.