mirror of
https://github.com/openai/codex-security.git
synced 2026-11-25 02:58:16 +08:00
ci: keep metadata edits from restarting source checks Co-authored-by: mldangelo-oai <269034524+mldangelo-oai@users.noreply.github.com>
24 lines
724 B
YAML
24 lines
724 B
YAML
name: Validate PR Title
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, edited, reopened, synchronize]
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
validate-pr-title:
|
|
name: Validate PR Title
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check conventional title
|
|
env:
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
run: |
|
|
conventional_title='^([a-z][a-z0-9-]*)(\([a-z0-9][a-z0-9._/-]*\))?(!)?:[ ]([^[:space:]].*[^[:space:]]|[^[:space:]])$'
|
|
if [[ "$PR_TITLE" == *$'\n'* || "$PR_TITLE" == *$'\r'* ||
|
|
! "$PR_TITLE" =~ $conventional_title ]]; then
|
|
echo '::error::Pull request title must follow <type>[optional scope][!]: <description>.'
|
|
exit 1
|
|
fi
|