Skip to content

Add lint github workflow. #1849

Add lint github workflow.

Add lint github workflow. #1849

Workflow file for this run

name: lint
on:
pull_request:
types: [opened, edited, reopened, synchronize]
branches:
- main
- feature/*
push:
branches:
- main
- feature/*
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.label.name || github.event.pull_request.number || github.sha }} @ ${{ github.event.label.name && github.event.pull_request.number || github.event.action }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Setup pre-commit
run: |
sudo apt update
sudo apt install python3 pre-commit gn
- name: Checkout files
uses: actions/checkout@v4
- name: Install pre-commit
run: |
pre-commit clean
pre-commit install --hook-type pre-commit --hook-type pre-push
- name: Run pre-commit
run: |
pre-commit run --show-diff-on-failure --color=always --from-ref ${{ github.event.pull_request.base.sha && github.event.pull_request.base.sha || github.event.before }} --to-ref HEAD
check-bug-id:
name: Check Bug ID
runs-on: ubuntu-latest
steps:
- name: Check Bug ID Present
# v2
uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee
with:
accessToken: ${{ secrets.GITHUB_TOKEN }}
pattern: '(b\/\d+|^(Bug|Fixed|Issue): \d+$|(partnerissuetracker\.corp|issuetracker)\.google\.com\/u\/\d+\/issues\/\d+$)'
flags: 'gm'
error: 'PR title or description should include at least one bug ID.'