https://github.com/jacobdomagala/compileresult
Github action for adding compile warnings/errors as PR comment.
https://github.com/jacobdomagala/compileresult
build comments compile cpp github-action github-actions pr-comment pull-requests
Last synced: 12 months ago
JSON representation
Github action for adding compile warnings/errors as PR comment.
- Host: GitHub
- URL: https://github.com/jacobdomagala/compileresult
- Owner: JacobDomagala
- License: mit
- Created: 2021-02-06T20:25:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-10T19:02:08.000Z (about 2 years ago)
- Last Synced: 2025-04-16T05:43:49.268Z (12 months ago)
- Topics: build, comments, compile, cpp, github-action, github-actions, pr-comment, pull-requests
- Language: JavaScript
- Homepage:
- Size: 335 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Compile Result
The Compile Result GitHub action parses build output for C/C++ based applications and creates a comment on the pull request with any issues found. The generated comment includes code snippets alongside descriptions of the identified issues. When this action runs for the first time, it creates a comment with the initial results for the current pull request. Subsequent runs will edit this comment to update the status.
## Output Example

## Workflow Example
```yml
name: Build on Ubuntu
on: [pull_request]
jobs:
Compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup
shell: bash
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake $GITHUB_WORKSPACE
cmake --build . 2> >(tee "output.txt")
- name: Post PR comment for warnings/errors
if: always()
uses: JacobDomagala/CompileResult@master
with:
comment_title: UBUNTU COMPILE RESULT
compile_result_file: ${{runner.workspace}}/build/output.txt
```
## Inputs
| Name | Required | Description | Default value |
|-------------------------|----------|------------------------------------------------------|:----------------------:|
| `compile_result_file` | TRUE | The file containing the compilation results | `empty` |
| `compiler` | TRUE | The compiler used to produce the output (MSVC/GNU/CLANG) | `GNU` |
| `token` | TRUE | GITHUB_TOKEN or a repo-scoped PAT | `${{github.token}}` |
| `work_dir` | TRUE | The action work directory | `${{github.workspace}}`|
| `exclude_dir` | FALSE | The full path to the directory to be ignored | `` |
| `pull_request_number` | TRUE | The GitHub Pull Request number | `${{github.event.pull_request.number}}`|
| `comment_title` | TRUE | The comment title displayed at the top of the comment. It is also used to determine whether the comment already exists and should be edited or not. | `COMPILE RESULT` |
| `num_lines_to_display` | FALSE | The number of lines for the code snippet displayed for each error/warning | `5` |
| `server_url` | FALSE | URL of GitHub Enterprise server (defaults to github.com) | `https://github.com` |