Skip to content

Commit e6a7aec

Browse files
authored
Merge pull request #834 from tsuyoshicho/feature/nvcheck
ci: Github Action workflow define : nvcheck,help tag
2 parents d1e27ea + 32aa266 commit e6a7aec

File tree

6 files changed

+151
-0
lines changed

6 files changed

+151
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM golang:1.15.6-alpine
2+
3+
ENV REVIEWDOG_VERSION=v0.11.0
4+
5+
# hadolint ignore=DL3006
6+
RUN apk --no-cache add git
7+
8+
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ ${REVIEWDOG_VERSION}
9+
10+
RUN go get github.com/koron/nvcheck
11+
12+
COPY entrypoint.sh /entrypoint.sh
13+
14+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Run nvcheck with reviewdog'
2+
description: '🐶Run nvcheck with reviewdog on pull requests to improve document writing experience.'
3+
author: 'Tsuyoshi CHO <Tsuyoshi.CHO+develop@Gmail.com>'
4+
inputs:
5+
github_token:
6+
description: 'GITHUB_TOKEN.'
7+
required: true
8+
default: ${{ github.token }}
9+
level:
10+
description: 'Report level for reviewdog [info,warning,error]'
11+
default: 'error'
12+
reporter:
13+
description: |
14+
Reporter of reviewdog command [github-check,github-pr-review].
15+
Default is github-pr-review.
16+
github-pr-review can use Markdown and add a link to rule page in reviewdog reports.
17+
default: 'github-pr-review'
18+
filter_mode:
19+
description: |
20+
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
21+
Default is added.
22+
default: 'added'
23+
fail_on_error:
24+
description: |
25+
Exit code for reviewdog when errors are found [true,false]
26+
Default is `false`.
27+
default: 'false'
28+
reviewdog_flags:
29+
description: 'Additional reviewdog flags'
30+
default: ''
31+
tool_name:
32+
description: 'Tool name to use for reviewdog reporter'
33+
default: 'nvcheck'
34+
runs:
35+
using: 'docker'
36+
image: 'Dockerfile'
37+
branding:
38+
icon: 'chevron-down'
39+
color: 'green'
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
3+
cd "$GITHUB_WORKSPACE" || true
4+
5+
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
6+
7+
# find doc -name \*.jax -print0 | xargs -0 nvcheck \
8+
# | reviewdog -f=checkstyle \
9+
# -name="${INPUT_TOOL_NAME}" \
10+
# -reporter="${INPUT_REPORTER:-github-pr-review}" \
11+
# -filter-mode="${INPUT_FILTER_MODE}" \
12+
# -fail-on-error="${INPUT_FAIL_ON_ERROR}" \
13+
# -level="${INPUT_LEVEL}" \
14+
# ${INPUT_REVIEWDOG_FLAGS}
15+
16+
# github-pr-review only diff adding
17+
if [ "${INPUT_REPORTER}" = "github-pr-review" ]; then
18+
# fix
19+
find doc -name \*.jax -print0 | xargs -0 nvcheck -i
20+
21+
TMPFILE=$(mktemp)
22+
git diff >"${TMPFILE}"
23+
24+
reviewdog \
25+
-name="nvcheck-fix" \
26+
-f=diff \
27+
-f.diff.strip=1 \
28+
-name="${INPUT_TOOL_NAME}-fix" \
29+
-reporter="github-pr-review" \
30+
-filter-mode="diff_context" \
31+
-level="${INPUT_LEVEL}" \
32+
${INPUT_REVIEWDOG_FLAGS} < "${TMPFILE}"
33+
34+
git restore . || true
35+
rm -f "${TMPFILE}"
36+
fi
37+
38+
# EOF

.github/workflows/depup.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: depup
2+
on:
3+
schedule:
4+
- cron: '35 9 2,13,25 * *' # Runs at 9:35 UTC 2,13,25 per month
5+
6+
jobs:
7+
reviewdog:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
with:
13+
submodules: true
14+
15+
- name: Check depup
16+
uses: haya14busa/action-depup@v1
17+
id: depup
18+
with:
19+
file: .github/actions/vimhelp-nvcheck/Dockerfile
20+
version_name: REVIEWDOG_VERSION
21+
repo: reviewdog/reviewdog
22+
23+
- name: Create Pull Request
24+
uses: peter-evans/create-pull-request@v3
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
title: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}"
28+
commit-message: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}"
29+
body: |
30+
Update ${{ steps.depup.outputs.repo }} to [${{ steps.depup.outputs.latest }}](https://github.com/${{ steps.depup.outputs.repo }}/releases/tag/v${{ steps.depup.outputs.latest }})
31+
32+
This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3A${{ github.workflow }}).
33+
branch: depup/${{ steps.depup.outputs.repo }}

.github/workflows/reviewdog.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: reviewdog
2+
on: pull_request
3+
jobs:
4+
nvcheck:
5+
name: runner / nvcheck
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
with:
11+
submodules: true
12+
- name: nvcheck-github-pr-review
13+
uses: ./.github/actions/vimhelp-nvcheck/
14+
with:
15+
github_token: ${{ secrets.github_token }}
16+
reporter: github-pr-review

.github/workflows/vimhelptagcheck.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "vim help tag name check"
2+
on: [push, pull_request]
3+
jobs:
4+
tagname:
5+
name: Check tag name conflict
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: checkout
9+
uses: actions/checkout@v2
10+
- name: help tag check
11+
uses: tsuyoshicho/action-vimhelp-tagname-check@v1

0 commit comments

Comments
 (0)