Skip to content

Commit

Permalink
Add lint github workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
briantting committed Oct 15, 2024
1 parent 55a1d8c commit 335e461
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/config/android-arm.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"docker_service": "linux",
"platforms": [
Expand Down
1 change: 0 additions & 1 deletion .github/config/android-chrobalt-arm.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"docker_service": "linux",
"platforms": [
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: lint

Check failure

Code scanning / Scorecard

Token-Permissions High

score is 0: no topLevel permission defined
Remediation tip: Visit https://app.stepsecurity.io/secureworkflow.
Tick the 'Restrict permissions for GITHUB_TOKEN'
Untick other options
NOTE: If you want to resolve multiple issues at once, you can visit https://app.stepsecurity.io/securerepo instead.
Click Remediation section below for further remediation help

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 gn pipx
pipx install pre-commit
- name: Checkout files
uses: actions/checkout@v4

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
- name: Install pre-commit
run: |
pre-commit clean
pre-commit install --hook-type pre-commit --hook-type pre-push
pre-commit --version
- 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.'

0 comments on commit 335e461

Please sign in to comment.