-
Notifications
You must be signed in to change notification settings - Fork 22
/
action.yml
67 lines (67 loc) · 2.54 KB
/
action.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: 'Pull request comments from clang-tidy reports'
description: 'Post clang-tidy warnings as review comments on pull requests'
inputs:
github_token:
description: 'The GitHub token'
required: true
clang_tidy_fixes:
description: 'Path to the clang-tidy fixes YAML file'
required: true
pull_request_id:
description: 'Pull request id (otherwise attempt to extract it from the GitHub metadata)'
required: false
default: ''
request_changes:
description: 'Request changes if there are clang-tidy issues (otherwise leave a comment)'
required: false
default: 'false'
suggestions_per_comment:
description: 'The number of suggestions per comment (smaller numbers work better for heavy pull requests)'
required: false
default: '10'
repo_path_prefix:
description: 'The path to repo when code is analyzed with clang-tidy; may set to "/__w" for users who run clang-tidy in a docker container'
required: false
default: '/home/runner/work'
auto_resolve_conversations:
description: 'Automatically resolve conversations when the clang-tidy issues are fixed'
required: false
default: 'false'
python_path:
description: 'Path to a Python executable to use; if not set Python will be installed locally'
required: false
default: ''
runs:
using: 'composite'
steps:
- name: Setup Python
if: ${{ !inputs.python_path }}
uses: actions/setup-python@v5
id: setup-python
with:
python-version: 3.11
update-environment: false
- name: Setup venv
run: |
"${{ steps.setup-python.outputs.python-path || inputs.python_path }}" -m venv "${GITHUB_ACTION_PATH}/venv"
shell: bash
- name: Install dependencies
run: |
"${GITHUB_ACTION_PATH}/venv/bin/python" -m pip install -r "${GITHUB_ACTION_PATH}/requirements.txt"
shell: bash
- name: Run action
run: |
"${GITHUB_ACTION_PATH}/action_launcher.bash"
shell: bash
env:
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_CLANG_TIDY_FIXES: ${{ inputs.clang_tidy_fixes }}
INPUT_PULL_REQUEST_ID: ${{ inputs.pull_request_id }}
INPUT_REQUEST_CHANGES: ${{ inputs.request_changes }}
INPUT_SUGGESTIONS_PER_COMMENT: ${{ inputs.suggestions_per_comment }}
INPUT_REPO_PATH_PREFIX: ${{ inputs.repo_path_prefix }}
INPUT_AUTO_RESOLVE_CONVERSATIONS: ${{ inputs.auto_resolve_conversations }}
PULL_REQUEST_ID: ${{ github.event.issue.number || github.event.number || '' }}
branding:
icon: 'cpu'
color: 'green'