-
Notifications
You must be signed in to change notification settings - Fork 792
53 lines (47 loc) · 1.8 KB
/
pr_lint_review.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# GitHub Action to run Verible linting on pull requests and add review comments.
#
# See https://github.com/chipsalliance/verible-linter-action.
name: pr-lint-review
# Triggers when there is any activity on a pull request, e.g. opened, updated.
#
# The action runs in the context of the _base_ of the pull request, but later we
# checkout the repository at the pull request's HEAD to run linting.
on:
pull_request_target:
jobs:
verible-lint:
runs-on: ubuntu-latest
# Grant only write permissions for setting checks and adding review comments
# to pull requests.
permissions:
checks: write
contents: read
pull-requests: write
env:
verible_config: hw/lint/tools/veriblelint/lowrisc-styleguide.rules.verible_lint
steps:
- uses: actions/checkout@v3
with:
# Because `pull_request_target` runs at the PR's base, we need to
# checkout the head of the PR before running the lint.
ref: ${{ github.event.pull_request.head.sha }}
- name: Prepare Verible config
run: |
echo "Concatenating Verible waivers"
find . -type f -name '*.vbl' -exec cat {} \; >> verible_waiver
echo "::group::Verible config"
cat "$verible_config"
echo "::endgroup::"
echo "::group::Verible waiver"
cat "verible_waiver"
echo "::endgroup::"
- name: Run Verible linter action
uses: chipsalliance/verible-linter-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
suggest_fixes: 'false'
config_file: ${{ env.verible_config }}
extra_args: "--waiver_files=verible_waiver"