Repository navigation
fix(perf): CWV quick wins - charset, font-display swap, defer GTM, landmark main #37
Workflow file for this run
This file contains hidden or 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: PR Title | |
| # PRs are squash-merged, so the title becomes the commit subject on main. Keep it a | |
| # Conventional Commit and keep issue-tracker IDs out of the history. | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize, reopened] | |
| permissions: | |
| pull-requests: read | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Validate Conventional Commit title | |
| uses: amannn/action-semantic-pull-request@66e72920af32222769c386d81f89656ebcb6d6d5 # v6.1.4 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| types: | | |
| feat | |
| fix | |
| perf | |
| revert | |
| build | |
| chore | |
| ci | |
| docs | |
| style | |
| refactor | |
| test | |
| - name: Reject tracker IDs | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| # Read the current title, as the Conventional Commit check above does, so both rules see one value. | |
| TITLE="$(gh pr view "$PR_NUMBER" --json title --jq .title)" | |
| ids="$(printf '%s\n' "$TITLE" | grep -oE '\b[A-Z]{2,6}-[0-9]+\b' | grep -vE '^(AES|CVE|ECMA|ES|HTTP|ISO|RFC|RSA|SHA|TLS|UTF)-' || true)" | |
| if [[ -n "$ids" ]] || printf '%s\n' "$TITLE" | grep -qi 'linear\.app'; then | |
| echo "::error::Remove issue-tracker IDs and links from the PR title: ${ids}" | |
| exit 1 | |
| fi |