[Instruction][TMA] Add TMA related instructions #115
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Title Check | |
on: | |
pull_request: | |
types: [opened, edited, synchronize] | |
jobs: | |
check-title: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Check PR Title Format | |
id: check-title | |
run: | | |
#!/bin/bash | |
MAX_TITLE_LENGTH=72 | |
PR_TITLE='${{ github.event.pull_request.title }}' | |
# Ensure the title matches the format [Category1][Category2]...[CategoryN] A sentence | |
if [[ ! "$PR_TITLE" =~ ^(\[[^\]]+\])+ ]]; then | |
echo "::error::PR title must be in the format '[Category1][Category2]...[CategoryN] A sentence'." | |
exit 1 | |
fi | |
# Ensure there is a space after the last category | |
if [[ ! "$PR_TITLE" =~ ^(\[[^\]]+\])+\ .+ ]]; then | |
echo "::error::PR title must contain a space after the last category." | |
exit 1 | |
fi | |
# Ensure the title length is within the limit | |
if (( ${#PR_TITLE} > MAX_TITLE_LENGTH )); then | |
echo "::error::PR title exceeds the maximum length of $MAX_TITLE_LENGTH characters." | |
exit 1 | |
fi | |
echo "PR title format and length are valid." | |
- name: Set status to success | |
if: success() | |
run: echo "Title check passed." |