diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml index fe12d03..041eddd 100644 --- a/.github/workflows/depup.yml +++ b/.github/workflows/depup.yml @@ -1,7 +1,8 @@ +--- 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: @@ -16,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/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..70cc4ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,11 @@ +--- name: release on: push: branches: - main tags: - - "v*.*.*" + - v*.*.* pull_request: types: - labeled @@ -19,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 }} @@ -33,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 a95461f..0c95f1a 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -1,3 +1,4 @@ +--- name: reviewdog on: push: @@ -14,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 }} @@ -38,6 +39,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 @@ -47,7 +58,7 @@ jobs: with: reporter: github-check level: warning - locale: "US" + locale: US alex: name: runner / alex 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/.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 diff --git a/README.md b/README.md index e8ffade..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: '' ``` @@ -105,6 +106,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) diff --git a/action.yml b/action.yml index c658e17..fb611a6 100644 --- a/action.yml +++ b/action.yml @@ -1,44 +1,46 @@ -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: @@ -64,5 +66,5 @@ runs: # Ref: https://haya14busa.github.io/github-action-brandings/ branding: - icon: 'check-circle' - color: 'red' + icon: check-circle + color: red