feat: new infra for code snippets #14453
Workflow file for this run
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: "Lint PR" | |
on: | |
pull_request: | |
types: | |
- opened | |
- edited | |
- synchronize | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
dependency-check: | |
name: Validate Dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: CI Setup | |
uses: ./.github/actions/ci-setup | |
- name: Validate Dependencies | |
run: pnpm depcheck | |
validate-pr: | |
name: Validate PR content | |
runs-on: ubuntu-latest | |
steps: | |
- uses: amannn/action-semantic-pull-request@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
types: | | |
feat | |
fix | |
chore | |
build | |
docs | |
ci | |
rc | |
- name: Check PR title length | |
env: | |
TITLE: ${{ github.event.pull_request.title }} | |
run: | | |
title_length=${#TITLE} | |
if [ $title_length -gt 72 ] | |
then | |
echo "PR title is too long (greater than 72 characters)" | |
exit 1 | |
fi | |
- name: Verify PR has breaking changes section | |
if: contains(github.event.pull_request.title, '!') | |
env: | |
PR_BODY: ${{ github.event.pull_request.body }} | |
run: | | |
if [[ "${PR_BODY}" != *"# Breaking Changes"*"# Checklist"* ]]; then | |
echo "This is a breaking change PR." | |
echo "Please add a '# Breaking Changes' section in the PR's body before the '# Checklist' section." | |
exit 1 | |
fi |