From 30910d5481d9472fd4398312408d3195311aadc2 Mon Sep 17 00:00:00 2001 From: blooper05 Date: Tue, 7 Jun 2022 18:50:39 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=91=B7=20ci(actions):=20Add=20`yamlli?= =?UTF-8?q?nt`=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/reviewdog.yml | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index a95461f..7cf3256 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -38,6 +38,16 @@ jobs: reporter: github-check level: warning + yamllint: + name: runner / yamllint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: reviewdog/action-yamllint@v1 + with: + reporter: github-check + level: warning + misspell: name: runner / misspell runs-on: ubuntu-latest diff --git a/README.md b/README.md index e8ffade..c187969 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Supported linters: - [reviewdog/action-shellcheck](https://github.com/reviewdog/action-shellcheck) - [reviewdog/action-shfmt](https://github.com/reviewdog/action-shfmt) - [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) +- [reviewdog/action-yamllint](https://github.com/reviewdog/action-yamllint) - [reviewdog/action-misspell](https://github.com/reviewdog/action-misspell) - [reviewdog/action-alex](https://github.com/reviewdog/action-alex) From 80c0b8c3ac8ae2966ee39313c03371a4196d70c1 Mon Sep 17 00:00:00 2001 From: blooper05 Date: Wed, 8 Jun 2022 11:40:45 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=9A=A8=20style(yamllint):=20Initial?= =?UTF-8?q?=20setup=20of=20`yamllint`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .yamllint.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .yamllint.yml diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..14ec9cc --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,12 @@ +--- +extends: default + +rules: + line-length: + max: 120 + quoted-strings: + quote-type: single + required: only-when-needed + truthy: + ignore: | + /.github/workflows/*.yml From 0c97031616e5d248df4be01a39eb5147aff15a10 Mon Sep 17 00:00:00 2001 From: blooper05 Date: Wed, 8 Jun 2022 11:41:58 +0900 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=9A=A8=20style(yamllint):=20Fix=20the?= =?UTF-8?q?=20`document-start`=20warning=20from=20`yamllint`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/depup.yml | 1 + .github/workflows/labels.yml | 1 + .github/workflows/release.yml | 1 + .github/workflows/reviewdog.yml | 1 + .github/workflows/test.yml | 1 + action.yml | 1 + 6 files changed, 6 insertions(+) diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml index fe12d03..18b77d6 100644 --- a/.github/workflows/depup.yml +++ b/.github/workflows/depup.yml @@ -1,3 +1,4 @@ +--- name: depup on: schedule: diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 1aaf7ee..dc956e9 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -1,3 +1,4 @@ +--- name: labels on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3fe8750..6bec3d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,4 @@ +--- name: release on: push: diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 7cf3256..63ee17d 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -1,3 +1,4 @@ +--- name: reviewdog on: push: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f3bf77..eadc4db 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,3 +1,4 @@ +--- name: test on: push: diff --git a/action.yml b/action.yml index c658e17..8d7b3e0 100644 --- a/action.yml +++ b/action.yml @@ -1,3 +1,4 @@ +--- name: 'Run rails_best_practices with reviewdog' description: '🐶 Run rails_best_practices with reviewdog on pull requests to improve code review experience.' author: 'blooper05' From 4b789dfafe29affe71cf37b95a91d44d36fb6697 Mon Sep 17 00:00:00 2001 From: blooper05 Date: Wed, 8 Jun 2022 11:45:43 +0900 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=9A=A8=20style(yamllint):=20Fix=20the?= =?UTF-8?q?=20`comments`=20warning=20from=20`yamllint`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/depup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml index 18b77d6..99a13bb 100644 --- a/.github/workflows/depup.yml +++ b/.github/workflows/depup.yml @@ -2,7 +2,7 @@ name: depup on: schedule: - - cron: "14 14 * * *" # Runs at 14:14 UTC every day + - cron: "14 14 * * *" # Runs at 14:14 UTC every day repository_dispatch: types: [depup] workflow_dispatch: From 92a08a4d47bc2b0314ab667b58f28e3d1daa4e31 Mon Sep 17 00:00:00 2001 From: blooper05 Date: Wed, 8 Jun 2022 11:51:45 +0900 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=9A=A8=20style(yamllint):=20Fix=20the?= =?UTF-8?q?=20`quoted-strings`=20warning=20from=20`yamllint`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/depup.yml | 4 ++-- .github/workflows/release.yml | 10 ++++----- .github/workflows/reviewdog.yml | 6 ++--- action.yml | 40 ++++++++++++++++----------------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml index 99a13bb..041eddd 100644 --- a/.github/workflows/depup.yml +++ b/.github/workflows/depup.yml @@ -2,7 +2,7 @@ name: depup on: schedule: - - cron: "14 14 * * *" # Runs at 14:14 UTC every day + - cron: 14 14 * * * # Runs at 14:14 UTC every day repository_dispatch: types: [depup] workflow_dispatch: @@ -17,4 +17,4 @@ jobs: file: action.yml version_name: reviewdog_version repo: reviewdog/reviewdog - labels: "bump:minor" + labels: bump:minor diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6bec3d5..70cc4ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: branches: - main tags: - - "v*.*.*" + - v*.*.* pull_request: types: - labeled @@ -20,13 +20,13 @@ jobs: # Bump version on merging Pull Requests with specific labels. # (bump:major,bump:minor,bump:patch) - id: bumpr - if: "!startsWith(github.ref, 'refs/tags/')" + if: '!startsWith(github.ref, ''refs/tags/'')' uses: haya14busa/action-bumpr@v1 # Update corresponding major and minor tag. # e.g. Update v1 and v1.2 when releasing v1.2.3 - uses: haya14busa/action-update-semver@v1 - if: "!steps.bumpr.outputs.skip" + if: '!steps.bumpr.outputs.skip' with: tag: ${{ steps.bumpr.outputs.next_version }} @@ -34,12 +34,12 @@ jobs: - id: tag uses: haya14busa/action-cond@v1 with: - cond: "${{ startsWith(github.ref, 'refs/tags/') }}" + cond: ${{ startsWith(github.ref, 'refs/tags/') }} if_true: ${{ github.ref }} if_false: ${{ steps.bumpr.outputs.next_version }} # Create release - - if: "steps.tag.outputs.value != ''" + - if: steps.tag.outputs.value != '' env: TAG_NAME: ${{ steps.tag.outputs.value }} BODY: ${{ steps.bumpr.outputs.message }} diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 63ee17d..0c95f1a 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -15,8 +15,8 @@ jobs: id: reporter with: cond: ${{ github.event_name == 'pull_request' }} - if_true: "github-pr-review" - if_false: "github-check" + if_true: github-pr-review + if_false: github-check - uses: reviewdog/action-shellcheck@v1 with: reporter: ${{ steps.reporter.outputs.value }} @@ -58,7 +58,7 @@ jobs: with: reporter: github-check level: warning - locale: "US" + locale: US alex: name: runner / alex diff --git a/action.yml b/action.yml index 8d7b3e0..9932e06 100644 --- a/action.yml +++ b/action.yml @@ -1,45 +1,45 @@ --- -name: 'Run rails_best_practices with reviewdog' -description: '🐶 Run rails_best_practices with reviewdog on pull requests to improve code review experience.' -author: 'blooper05' +name: Run rails_best_practices with reviewdog +description: 🐶 Run rails_best_practices with reviewdog on pull requests to improve code review experience. +author: blooper05 inputs: github_token: - description: 'GITHUB_TOKEN' - default: '${{ github.token }}' + description: GITHUB_TOKEN + default: ${{ github.token }} workdir: - description: 'Working directory relative to the root directory.' - default: '.' + description: Working directory relative to the root directory. + default: . ### Flags for reviewdog ### tool_name: - description: 'Tool name to use for reviewdog reporter' - default: 'rails_best_practices' + description: Tool name to use for reviewdog reporter + default: rails_best_practices level: - description: 'Report level for reviewdog [info,warning,error]' - default: 'error' + description: Report level for reviewdog [info,warning,error] + default: error reporter: - description: 'Reporter of reviewdog command [github-check,github-pr-review,github-pr-check].' - default: 'github-check' + description: Reporter of reviewdog command [github-check,github-pr-review,github-pr-check]. + default: github-check filter_mode: description: | Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. Default is added. - default: 'added' + default: added fail_on_error: description: | Exit code for reviewdog when errors are found [true,false] Default is `false`. default: 'false' reviewdog_flags: - description: 'Additional reviewdog flags' + description: Additional reviewdog flags default: '' ### Flags for rails_best_practices ### rails_best_practices_version: - description: 'rails_best_practices version' + description: rails_best_practices version rails_best_practices_flags: - description: 'rails_best_practices flags (rails_best_practices --without-color --silent . )' + description: rails_best_practices flags (rails_best_practices --without-color --silent . ) default: '' runs: - using: 'composite' + using: composite steps: - uses: reviewdog/action-setup@v1 with: @@ -65,5 +65,5 @@ runs: # Ref: https://haya14busa.github.io/github-action-brandings/ branding: - icon: 'check-circle' - color: 'red' + icon: check-circle + color: red From d3f747de4be8a5fb2a60deb0040985068fb6bee8 Mon Sep 17 00:00:00 2001 From: blooper05 Date: Wed, 8 Jun 2022 11:56:44 +0900 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=9A=A8=20style(yamllint):=20Fix=20the?= =?UTF-8?q?=20`line-length`=20warning=20from=20`yamllint`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 9932e06..fb611a6 100644 --- a/action.yml +++ b/action.yml @@ -36,7 +36,8 @@ inputs: rails_best_practices_version: description: rails_best_practices version rails_best_practices_flags: - description: rails_best_practices flags (rails_best_practices --without-color --silent . ) + description: | + rails_best_practices flags (rails_best_practices --without-color --silent . ) default: '' runs: using: composite From 4f6e0765de9e1198940b4a747890a2c426e5c00e Mon Sep 17 00:00:00 2001 From: blooper05 Date: Wed, 8 Jun 2022 11:59:33 +0900 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=93=9D=20docs(actions):=20Sync=20`inp?= =?UTF-8?q?ut`=20section=20of=20`action.yml`=20with=20that=20of=20`README.?= =?UTF-8?q?md`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c187969..ef1ba2d 100644 --- a/README.md +++ b/README.md @@ -21,39 +21,40 @@ code review experience. ```yaml inputs: github_token: - description: 'GITHUB_TOKEN' - default: '${{ github.token }}' + description: GITHUB_TOKEN + default: ${{ github.token }} workdir: - description: 'Working directory relative to the root directory.' - default: '.' + description: Working directory relative to the root directory. + default: . ### Flags for reviewdog ### tool_name: - description: 'Tool name to use for reviewdog reporter' - default: 'rails_best_practices' + description: Tool name to use for reviewdog reporter + default: rails_best_practices level: - description: 'Report level for reviewdog [info,warning,error]' - default: 'error' + description: Report level for reviewdog [info,warning,error] + default: error reporter: - description: 'Reporter of reviewdog command [github-check,github-pr-review,github-pr-check].' - default: 'github-check' + description: Reporter of reviewdog command [github-check,github-pr-review,github-pr-check]. + default: github-check filter_mode: description: | Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. Default is added. - default: 'added' + default: added fail_on_error: description: | Exit code for reviewdog when errors are found [true,false] Default is `false`. default: 'false' reviewdog_flags: - description: 'Additional reviewdog flags' + description: Additional reviewdog flags default: '' ### Flags for rails_best_practices ### rails_best_practices_version: - description: 'rails_best_practices version' + description: rails_best_practices version rails_best_practices_flags: - description: 'rails_best_practices flags (rails_best_practices --without-color --silent . )' + description: | + rails_best_practices flags (rails_best_practices --without-color --silent . ) default: '' ```