Skip to content

Commit 35e93c3

Browse files
committed
feat(reviewdog): add reusable workflow
1 parent 29b6424 commit 35e93c3

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/reviewdog.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Reusable Reviewdog Workflow"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
reviewdog_app_id:
7+
description: "GitHub App ID for Reviewdog"
8+
required: true
9+
type: string
10+
reviewdog_private_key:
11+
description: "GitHub App private key for Reviewdog"
12+
required: true
13+
type: string
14+
reporter:
15+
description: "Reviewdog reporter (e.g., github-pr-review)"
16+
required: false
17+
type: string
18+
default: "github-pr-review"
19+
filter_mode:
20+
description: "Filter mode (e.g., added, diff_context)"
21+
required: false
22+
type: string
23+
default: "added"
24+
tool_name:
25+
description: "Name of the linter tool"
26+
required: false
27+
type: string
28+
default: ""
29+
tool_command:
30+
description: "Command to run the linter"
31+
required: true
32+
type: string
33+
secrets:
34+
REVIEWDOG_APP_ID:
35+
required: true
36+
REVIEWDOG_PRIVATE_KEY:
37+
required: true
38+
jobs:
39+
reviewdog:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
45+
- name: Get Token
46+
id: get_token
47+
uses: peter-murray/workflow-application-token-action@v4
48+
with:
49+
application_id: ${{ secrets.REVIEWDOG_APP_ID }}
50+
application_private_key: ${{ secrets.REVIEWDOG_PRIVATE_KEY }}
51+
organization: ${{ github.repository_owner }}
52+
53+
- name: Run reviewdog
54+
uses: reviewdog/[email protected]
55+
with:
56+
github_token: ${{ steps.get_token.outputs.token }}
57+
reporter: ${{ inputs.reporter }}
58+
filter_mode: ${{ inputs.filter_mode }}
59+
tool_name: ${{ inputs.tool_name }}
60+
reviewdog_cmd: ${{ inputs.tool_command }}

reviewdog/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ReviewDog

0 commit comments

Comments
 (0)