Skip to content

FIX

FIX #36

Workflow file for this run

name: format

Check failure on line 1 in .github/workflows/format.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/format.yml

Invalid workflow file

(Line: 19, Col: 9): Unexpected value 'depth'
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
permissions:
contents: read
security-events: write
jobs:
analyze:
name: Check code formatting
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci-skip-format') }}
steps:
- name: Checkout
uses: actions/checkout@v4
depth: 0
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Run bazel format
run: |
# The --include_autogenerated_targets=True is needed to create the autogenerated targets.
# Without it, bazel wrapper hook scripts append some additional args that break the formatting check.
bazel run format --include_autogenerated_targets=True -- --origin-branch=origin/${{ github.base_ref }}
- name: Verify formatting
run: |
if ! git diff --quiet; then
echo "::error::Formatting issues detected."
echo ""
echo "Your PR is not properly formatted."
echo ""
echo "To fix the problem locally, run:"
echo ""
echo " bazel run format"
echo ""
echo "and commit the resulting changes."
echo ""
echo "Affected files:"
git diff --stat
echo "Diff:"
git diff | head -n 1000
exit 1
fi