Skip to content

Commit

Permalink
[Internal] Enforce Tag on PRs (#969)
Browse files Browse the repository at this point in the history
## Changes
Enforce Tag on PRs

## Tests
- [ ] `make test` passing
- [ ] `make fmt` applied
- [ ] relevant integration tests applied
- [X] New check as part of the PR
  • Loading branch information
hectorcast-db authored Jul 9, 2024
1 parent 82b07c8 commit a6222c8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
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
19 changes: 19 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,22 @@ jobs:
run: |
# Exit with status code 1 if there are differences (i.e. unformatted files)
git diff --exit-code
commit-message:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate Tag
run: |
TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p')
if grep -q "tag: \"[$TAG]\"" .codegen/changelog_config.yml; then
echo "Invalid or missing tag in commit message: [$TAG]"
exit 1
else
echo "Valid tag found: [$TAG]"
fi

0 comments on commit a6222c8

Please sign in to comment.