Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): Add reviewdog implementation #4

Merged
merged 11 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/lint-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Changelog Linter
on:
pull_request:

permissions:
pull-requests: write
contents: read

jobs:
lint-changelog:
runs-on: ubuntu-latest
Expand All @@ -12,5 +16,8 @@ jobs:
uses: actions/checkout@v4

- name: Run changelog linter
uses: MalteHerrmann/changelog-lint-action@0918ef12e6dc06adce0743e1c6c13707a7c20323
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}


1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ This changelog was created using the `clu` binary

### Features

MalteHerrmann marked this conversation as resolved.
Show resolved Hide resolved
- (ci) [#2](https://github.com/MalteHerrmann/changelog-lint-action/pull/2) add reviewdog to have PR review comments available.
MalteHerrmann marked this conversation as resolved.
Show resolved Hide resolved
- (ci) [#1](https://github.com/MalteHerrmann/changelog-lint-action/pull/1) Add action implementation.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ FROM ghcr.io/malteherrmann/changelog-utils:latest

WORKDIR /github/workspace

CMD ["lint"]
COPY entrypoint.sh .

ENTRYPOINT ["./entrypoint.sh"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog Lint Action

This GitHub action brings the linter from the [changelog-utils](https://github.com/MalteHerrmann/changelog-utils)
to your CI workflows.

It's using [reviewdog](https://github.com/reviewdog/reviewdog) to post comments on PR reviews that show any potential
problems with your changelogs.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'Changelog Linter'
description: 'A linter for your changelog. Based on https://github.com/MalteHerrmann/changelog-utils'
author: 'Malte Herrmann'
inputs:
github_token:
description: 'GITHUB_TOKEN'
default: '${{ github.token }}'
outputs:
linter-results:
description: 'Changelog linter output'
Expand Down
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -ex

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

clu lint | reviewdog -efm="%f:%l: %m" \
-name="clu" \
-reporter="github-pr-review" \
-filter-mode="nofilter" \
-fail-on-error="true"