Skip to content

v0.5.0 — Pull Request Comments

Choose a tag to compare

@sabahattink sabahattink released this 05 Oct 02:41
· 29 commits to main since this release
ded75b8

Pull request comments: CodeDiag now keeps one comment on each pull request with the score and the findings in the files that pull request changes.

permissions:
  contents: read
  pull-requests: write

jobs:
  codediag:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: sabahattink/codediag@v0
        with:
          threshold: 80
          comment: true

What the comment shows

  • ✅ or ❌: the score and grade against your threshold.
  • The change since the previous push, such as ▲ +3 since the last run.
  • The analyzer table.
  • Findings in the files this pull request adds or modifies. Critical findings come first, and each rule links to its documentation.
  • A count of findings elsewhere in the project, plus suppressed and baseline findings.

Every push updates the same comment, so the pull request never collects duplicates.

Safe by default

  • comment is off unless you set it to true.
  • Runs outside a pull request skip the comment.
  • If the comment can't be written (for example, a fork's read-only token), the Action logs a warning. The scan result, outputs, and threshold gate work as before.
  • No new dependencies. The comment uses the workflow's GITHUB_TOKEN through the REST API.

See the GitHub Action guide.

Full changelog: https://github.com/sabahattink/codediag/blob/main/CHANGELOG.md