feat: stating to main #47
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
name: Validate Pull Request | |
on: | |
pull_request: | |
types: [opened, edited, reopened, ready_for_review, labeled, synchronize] | |
jobs: | |
validate-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check PR compliance | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const pr = context.payload.pull_request; | |
const titlePattern = /^(feat|fix|chore|docs|test):\s.+$/; | |
if (!titlePattern.test(pr.title)) { | |
core.setFailed("❌ O título do PR deve começar com 'feat:', 'fix:', 'chore:', 'docs:' ou 'test:'."); | |
} | |
if (pr.assignees.length === 0) { | |
core.setFailed("❌ Adicione pelo menos um responsável (assignee) ao PR."); | |
} | |
if (pr.labels.length === 0) { | |
core.setFailed("❌ Adicione pelo menos uma label ao PR."); | |
} | |
core.notice("✅ Todas as validações do PR foram aprovadas!"); |