Skip to content

Commit

Permalink
Merge pull request #3 from blooper05/add-action-yamllint
Browse files Browse the repository at this point in the history
👷 ci(actions): Add `yamllint` job
  • Loading branch information
blooper05 authored Jun 8, 2022
2 parents 8adcbbc + 4f6e076 commit e4df4ea
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 44 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/depup.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -16,4 +17,4 @@ jobs:
file: action.yml
version_name: reviewdog_version
repo: reviewdog/reviewdog
labels: "bump:minor"
labels: bump:minor
1 change: 1 addition & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: labels
on:
push:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: release
on:
push:
branches:
- main
tags:
- "v*.*.*"
- v*.*.*
pull_request:
types:
- labeled
Expand All @@ -19,26 +20,26 @@ 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 }}

# Get tag name.
- 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 }}
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: reviewdog
on:
push:
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -47,7 +58,7 @@ jobs:
with:
reporter: github-check
level: warning
locale: "US"
locale: US

alex:
name: runner / alex
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: test
on:
push:
Expand Down
12 changes: 12 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 . <rails_best_practices_flags>)'
description: |
rails_best_practices flags (rails_best_practices --without-color --silent . <rails_best_practices_flags>)
default: ''
```
Expand Down Expand Up @@ -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)
Expand Down
42 changes: 22 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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 . <rails_best_practices_flags>)'
description: |
rails_best_practices flags (rails_best_practices --without-color --silent . <rails_best_practices_flags>)
default: ''
runs:
using: 'composite'
using: composite
steps:
- uses: reviewdog/action-setup@v1
with:
Expand All @@ -64,5 +66,5 @@ runs:

# Ref: https://haya14busa.github.io/github-action-brandings/
branding:
icon: 'check-circle'
color: 'red'
icon: check-circle
color: red

0 comments on commit e4df4ea

Please sign in to comment.