Skip to content

[DEVOPS-3735] ci: github actions for PR static check #6

[DEVOPS-3735] ci: github actions for PR static check

[DEVOPS-3735] ci: github actions for PR static check #6

Workflow file for this run

name: "Lint"
on:
pull_request:
types: [opened, synchronize, reopened, edited ]
paths-ignore:
- README.md
- 'docs/**'
jobs:
gh-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: 'false'
- name: Lint
run: |
docker run \
--user yugabyteci \
-v "$(pwd):$(pwd)" \
-w "$(pwd)" \
yugabyteci/yb_build_infra_ubuntu2204_x86_64:latest \
bash -c '
set -euo pipefail
export PATH=/usr/local/bin:\$HOME/yb-cpplint/cpplint:\$PATH
echo ::group::Lint
# Base reference should not be set for non-PR actions.
if [[ -n \"${{ github.base_ref }}\" ]]; then
echo Base reference: ${{ github.base_ref }}
git fetch origin ${{ github.base_ref }}
./build-support/lint.py --rev origin/${{ github.base_ref }}
else
echo No base reference: Skipping Lint Step
exit
fi
'