Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lint github workflow. #715

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/actions/pre_commit/action.yaml

This file was deleted.

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
51 changes: 51 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: lint
Fixed Show fixed Hide fixed

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

permissions: {}

jobs:
lint:
name: Pre-Commit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Install pre-commit
run: |
sudo apt update
sudo apt update
sudo apt install python3 gn pre-commit
pre-commit --version
- name: Checkout
uses: actions/checkout@v4

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: GitHub-owned GitHubAction not pinned by hash
Remediation tip: update your workflow using https://app.stepsecurity.io
Click Remediation section below for further remediation help
with:
fetch-depth: 0
- name: Run pre-commit
run: |
pre-commit install --hook-type pre-commit --hook-type pre-push
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: Bug ID Check
runs-on: ubuntu-latest
steps:
- name: Bug ID Check
# 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.'
8 changes: 2 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ jobs:
)
timeout-minutes: 10
steps:
- name: Checkout files
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Remove runtest if exists
if: github.event_name == 'pull_request'
continue-on-error: true # Ignore this step if we cannot remove the label.
Expand Down Expand Up @@ -85,10 +83,8 @@ jobs:
needs: [initialize]
runs-on: [self-hosted, chrobalt-linux-runner]
steps:
- name: Checkout files
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
# Handle GitHub registry used for everything other than pull requests off forked repos.
- name: Login to GitHub Docker Registry
if: ${{ (github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == github.repository) }}
Expand Down
Loading