name: Validate Pull Request on: pull_request: types: - opened - reopened - synchronize - labeled - unlabeled - edited permissions: {} jobs: required-labels-missing: name: required labels missing runs-on: ubuntu-latest permissions: contents: read steps: - name: check if: >- !contains(github.event.pull_request.labels.*.name, '💥 breaking-change') && !contains(github.event.pull_request.labels.*.name, '✨ enhancement') && !contains(github.event.pull_request.labels.*.name, '🐞 bug') && !contains(github.event.pull_request.labels.*.name, '📖 docs') && !contains(github.event.pull_request.labels.*.name, 'chore') && !contains(github.event.pull_request.labels.*.name, '🛠️ dependencies') run: >- echo One of the following labels is missing on this PR: breaking-change enhancement bug docs chore && exit 1 validate-title: name: check title prefix runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: 'false' - name: check run: | PR_TITLE_PREFIX=$(echo "$PR_TITLE" | cut -d':' -f1) if [[ "$PR_TITLE_PREFIX" == "fix"* ]] || [[ "$PR_TITLE_PREFIX" == "feat"* ]] || [[ "$PR_TITLE_PREFIX" == "docs"* ]] || [[ "$PR_TITLE_PREFIX" == "chore"* ]]; then exit 0 fi echo "PR title must start with feat, fix, docs or chore" exit 1 env: PR_TITLE: ${{ github.event.pull_request.title }}