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

test: review composition 2nd #126

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
16 changes: 0 additions & 16 deletions .github/workflows/dockerimage.yml

This file was deleted.

13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

18 changes: 16 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,22 @@ inputs:
description: 'Tool name to use for reviewdog reporter'
default: 'textlint'
runs:
using: 'docker'
image: 'Dockerfile'
using: 'composite'
steps:
- run: $GITHUB_ACTION_PATH/script.sh
shell: sh
env:
REVIEWDOG_VERSION: v0.11.0
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_LEVEL: ${{ inputs.level }}
INPUT_REPORTER: ${{ inputs.reporter }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_TEXTLINT_FLAGS: ${{ inputs.textlint_flags }}
INPUT_TOOL_NAME: ${{ inputs.tool_name }}
branding:
icon: 'alert-octagon'
color: 'blue'
10 changes: 10 additions & 0 deletions doc/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Review Test Document

## unmatched pairs test

My Name is No Nameless(ななしではない, Good by.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [textlint] <eslint.rules.ja-technical-writing/no-unmatched-pair> reported by reviewdog 🐶
Not found pair character for (.

You should close this sentence with ).
This pair mark is called round bracket(). (ja-technical-writing/no-unmatched-pair)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [textlint] <eslint.rules.ja-technical-writing/no-double-negative-ja> reported by reviewdog 🐶
二重否定: 〜ないでもない (ja-technical-writing/no-double-negative-ja)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [textlint] <eslint.rules.ja-technical-writing/ja-no-mixed-period> reported by reviewdog 🐶
文末が"。"で終わっていません。 (ja-technical-writing/ja-no-mixed-period)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[textlint-fix] reported by reviewdog 🐶

Suggested change
My Name is No Nameless(ななしではない, Good by.
My Name is No Nameless(ななしではない, Good by


## max-ten tes

句読点が、多すぎて、読みにくい、ドキュメントを、抑制します。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [textlint] <eslint.rules.ja-technical-writing/max-ten> reported by reviewdog 🐶
一つの文で"、"を3つ以上使用しています (ja-technical-writing/max-ten)


30 changes: 21 additions & 9 deletions entrypoint.sh → script.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
#!/bin/sh
set -e

if [ -n "${GITHUB_WORKSPACE}" ] ; then
cd "${GITHUB_WORKSPACE}" || exit
fi
# shellcheck disable=SC2086,SC2089,SC2090

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
cd "${GITHUB_WORKSPACE}" || exit

TEMP_PATH="$(mktemp -d)"
PATH="${TEMP_PATH}:$PATH"

echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog'
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" "${REVIEWDOG_VERSION}" 2>&1
echo '::endgroup::'

# setup and check.
echo '::group:: Installing textlint ... https://github.com/textlint/textlint'
if [ -x "./node_modules/.bin/textlint" ]; then
# pass
:
echo 'already installed'
else
echo 'npm ci start'
npm ci
fi

if [ -x "./node_modules/.bin/textlint" ]; then
npx textlint --version
else
echo This repository was not configured for textlint, process done.
echo 'This repository was not configured for textlint, process done.'
exit 1
fi
echo '::endgroup::'

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"


echo '::group:: Running textlint with reviewdog 🐶 ...'
# shellcheck disable=SC2086
npx textlint -f checkstyle "${INPUT_TEXTLINT_FLAGS}" \
| reviewdog -f=checkstyle \
Expand All @@ -31,9 +40,11 @@ npx textlint -f checkstyle "${INPUT_TEXTLINT_FLAGS}" \
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
${INPUT_REVIEWDOG_FLAGS}
echo '::endgroup::'

# github-pr-review only diff adding
if [ "${INPUT_REPORTER}" = "github-pr-review" ]; then
echo '::group:: Running textlint fixing report 🐶 ...'
# fix
npx textlint --fix "${INPUT_TEXTLINT_FLAGS:-.}" || true

Expand All @@ -52,6 +63,7 @@ if [ "${INPUT_REPORTER}" = "github-pr-review" ]; then

git restore . || true
rm -f "${TMPFILE}"
echo '::endgroup::'
fi

# EOF