diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index efb7b29f..5b051175 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer diff --git a/README.md b/README.md index 85e0a56c..18515ff4 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: style: file + # The following value will only update a single comment + # in a pull request's thread. Set it to false to disable the comment. # Set it to true to post a new comment (and delete the old comment). + thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} - name: Fail fast?! if: steps.linter.outputs.checks-failed > 0 @@ -124,12 +127,18 @@ jobs: #### `thread-comments` -- **Description**: Set this option to true to enable the use of thread comments as feedback. +- **Description**: Set this option to true to enable the use of thread comments as feedback. Set this to 'update' to update an existing comment if one exists; the value 'true' will always delete an old comment and post a new one if necessary. - To use thread comments, the `GITHUB_TOKEN` (provided by Github to each repository) must be declared as an environment variable. See [Authenticating with the GITHUB_TOKEN](https://docs.github.com/en/actions/reference/authentication-in-a-workflow) - Default: false - NOTE: If run on a private repository, then this feature is disabled because the GitHub REST API behaves differently for thread comments on a private repository. +#### `no-lgtm` + +- **Description**: Set this option to true or false to enable or disable the use of a thread comment that basically says 'Looks Good To Me' (when all checks pass). + - See `thread-comments` option for further details. +- Default: true (as is no LGTM comment used) + #### `step-summary` - **Description**: Set this option to true to append content as part of workflow's job summary. diff --git a/action.yml b/action.yml index 5c765488..1a6410c0 100644 --- a/action.yml +++ b/action.yml @@ -6,9 +6,20 @@ branding: color: "green" inputs: thread-comments: - description: Set this option to true to enable the use of thread comments as feedback. Defaults to false. + description: >- + Set this option to 'true' or 'false' to enable or disable the use of + thread comments as feedback. Set this to 'update' to update an existing comment + if one exists; the value 'true' will always delete an old comment and post a new one + if necessary. Defaults to false. required: false - default: false + default: 'false' + no-lgtm: + description: >- + Set this option to true or false to enable or disable the use of a thread comment that + basically says 'Looks Good To Me' (when all checks pass). Defaults to true. + See `thread-comments` option for further details. + required: false + default: true step-summary: description: > Set this option to true to append content as part of workflow's job summary. Defaults to false. @@ -134,6 +145,7 @@ runs: --lines-changed-only=${{ inputs.lines-changed-only }} \ --files-changed-only=${{ inputs.files-changed-only }} \ --thread-comments=${{ inputs.thread-comments }} \ + --no-lgtm=${{ inputs.no-lgtm }} \ --step-summary=${{ inputs.step-summary }} \ --ignore="${{ inputs.ignore }}" \ --database=${{ inputs.database }} \ diff --git a/requirements.txt b/requirements.txt index 04236a47..7f7b97a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ clang-tools==0.8.0 # cpp-linter core Python executable package # For details please see: https://github.com/cpp-linter/cpp-linter -cpp-linter==1.6.0 +cpp-linter==1.6.1