-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move check pull request title to its own job and update lint.yml
- Loading branch information
1 parent
497d435
commit 6720f5d
Showing
2 changed files
with
38 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: check-pull-request-title | ||
|
||
on: | ||
pull_request: | ||
types: [assigned, edited, opened, synchronize, reopened] | ||
|
||
permissions: | ||
contents: read | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
run: | ||
runs-on: [self-hosted] | ||
steps: | ||
- name: Validate PR title | ||
run: | | ||
set -e | ||
pr_name="${{ github.event.pull_request.title }}" | ||
echo "PR Title: '$pr_name'" | ||
# Regex to check following: | ||
# Starts with "VIDCS-" followed by digits | ||
# A colon (:) followed by exactly one space | ||
# followed by the actual PR title text | ||
regex="^VIDCS-[0-9]+: [^ ].*$" | ||
if [[ "$pr_name" =~ $regex ]]; then | ||
echo "Acceptable title" | ||
exit 0 | ||
else | ||
echo "Rejected title" | ||
echo "Reason: The PR title must start with 'VIDCS-' followed by digits, a colon (:), and exactly one space, with the rest of the title immediately after the space." | ||
exit 1 | ||
fi | ||
shell: bash |
This file contains 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