diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3056a82..7bf081b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: ruby/setup-ruby@922ebc4c5262cd14e07bb0e1db020984b6c064fe # v1.226.0 with: - ruby-version: 3.0 + ruby-version: 3.4 bundler-cache: true - name: erb_lint with skip install and using bundler uses: ./ diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml new file mode 100644 index 0000000..832e7f0 --- /dev/null +++ b/.github/workflows/depup.yml @@ -0,0 +1,33 @@ +name: depup +on: + schedule: + - cron: "14 14 * * *" # Runs at 14:14 UTC every day + repository_dispatch: + types: [depup] + +jobs: + reviewdog: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: haya14busa/action-depup@d6b40096afad49ca676145faaba7190df29a9807 # v1.6.3 + id: depup + with: + file: action.yml + version_name: REVIEWDOG_VERSION + repo: reviewdog/reviewdog + + - name: Create Pull Request + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: "chore(deps): update reviewdog to ${{ steps.depup.outputs.latest }}" + commit-message: "chore(deps): update reviewdog to ${{ steps.depup.outputs.latest }}" + body: | + Update reviewdog to [v${{ steps.depup.outputs.latest }}](https://github.com/reviewdog/reviewdog/releases/tag/v${{ steps.depup.outputs.latest }}) + Compare [v${{ steps.depup.outputs.current }}...v${{ steps.depup.outputs.latest }}](https://github.com/reviewdog/reviewdog/compare/v${{ steps.depup.outputs.current }}...v${{ steps.depup.outputs.latest }}) + + This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3Adepup). + branch: depup/reviewdog + base: main + labels: "bump:minor" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c18c60b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: release +on: + push: + branches: + - main + tags: + - "v*.*.*" + pull_request: + types: + - labeled + +jobs: + release: + if: github.event.action != 'labeled' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + # Bump version on merging Pull Requests with specific labels. + # (bump:major,bump:minor,bump:patch) + - id: bumpr + if: "!startsWith(github.ref, 'refs/tags/')" + uses: haya14busa/action-bumpr@78ab5a104d20896c9c9122c64221b3aecf1a8cbb # v1.10.0 + + # Update corresponding major and minor tag. + # e.g. Update v1 and v1.2 when releasing v1.2.3 + - uses: haya14busa/action-update-semver@fb48464b2438ae82cc78237be61afb4f461265a1 # v1.2.1 + if: "!steps.bumpr.outputs.skip" + with: + tag: ${{ steps.bumpr.outputs.next_version }} + + # Get tag name. + - id: tag + uses: haya14busa/action-cond@94f77f7a80cd666cb3155084e428254fea4281fd # v1.2.1 + with: + cond: "${{ startsWith(github.ref, 'refs/tags/') }}" + if_true: ${{ github.ref }} + if_false: ${{ steps.bumpr.outputs.next_version }} + + # Create release + - if: "steps.tag.outputs.value != ''" + env: + TAG_NAME: ${{ steps.tag.outputs.value }} + BODY: ${{ steps.bumpr.outputs.message }} + # This token is provided by Actions, you do not need to create your own token + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create "${TAG_NAME}" -t "Release ${TAG_NAME/refs\/tags\//}" --notes "${BODY}" + + release-check: + if: github.event.action == 'labeled' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Post bumpr status comment + uses: haya14busa/action-bumpr@78ab5a104d20896c9c9122c64221b3aecf1a8cbb # v1.10.0 diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml new file mode 100644 index 0000000..4dc185e --- /dev/null +++ b/.github/workflows/reviewdog.yml @@ -0,0 +1,39 @@ +name: reviewdog +on: [pull_request] +jobs: + # Use shellcheck to lint shell scripts + shellcheck: + name: runner / shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: shellcheck + uses: reviewdog/action-shellcheck@6e0e63d1750d02d761b3df0f2c5ba9f9ac4a9ed7 # v1.29.0 + with: + github_token: ${{ secrets.github_token }} + + # Use misspell to correct spelling mistakes + misspell: + name: runner / misspell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: misspell + uses: reviewdog/action-misspell@18ffb61effb93b47e332f185216be7e49592e7e1 # v1.26.1 + with: + github_token: ${{ secrets.github_token }} + locale: "US" + + # Use yamllint to lint yaml files + yamllint: + name: check / yamllint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: yamllint + uses: reviewdog/action-yamllint@1dca3ad811867be18fbe293a9818d715a6c2cd46 # v1.20.0 + with: + github_token: ${{ secrets.github_token }} + reporter: github-pr-review + fail_level: any + yamllint_flags: '-d "{extends: default, rules: {truthy: disable}}" .' diff --git a/README.md b/README.md index eda9cab..028fd8e 100644 --- a/README.md +++ b/README.md @@ -93,23 +93,14 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0 with: - ruby-version: 3.0.3 + ruby-version: 3.4.5 - name: erb_lint uses: codeur/action-erblint@5083efd49634e26645a0736681b618ccc3fb7f14 # v2.19.2 with: - erblint_version: 4.8.2 + erblint_version: 0.9.0 reporter: github-pr-review # Default is github-pr-check ``` -## Sponsor - -

- - Sponsored by Evrone - -

- ## License [MIT](https://choosealicense.com/licenses/mit) diff --git a/action.yml b/action.yml index 2790344..4b8c2ca 100644 --- a/action.yml +++ b/action.yml @@ -8,7 +8,7 @@ inputs: erblint_version: description: 'erb_lint version' erblint_flags: - description: 'erb_lint flags. (erb_lint --lint-all --format compact --allow-no-files --fail-level F)' + description: 'erb_lint flags. (erb_lint --lint-all --format compact --allow-no-files --fail-level F --show-linter-names)' default: '' tool_name: description: 'Tool name to use for reviewdog reporter' diff --git a/script.sh b/script.sh index ea2b301..254bcab 100755 --- a/script.sh +++ b/script.sh @@ -54,7 +54,7 @@ echo '::group:: Running erb_lint with reviewdog 🐶 ...' ERBLINT_REPORT_FILE="$TEMP_PATH"/erblint_report # shellcheck disable=SC2086 -${BUNDLE_EXEC}erb_lint --lint-all --format compact --allow-no-files --fail-level F ${INPUT_ERBLINT_FLAGS} > "$ERBLINT_REPORT_FILE" +${BUNDLE_EXEC}erb_lint --lint-all --format compact --allow-no-files --fail-level F --show-linter-names ${INPUT_ERBLINT_FLAGS} > "$ERBLINT_REPORT_FILE" reviewdog < "$ERBLINT_REPORT_FILE" \ -efm="%f:%l:%c: %m" \ -name="${INPUT_TOOL_NAME}" \ diff --git a/test/using_bundler/Gemfile.lock b/test/using_bundler/Gemfile.lock index b7ec9f6..d9fa5c4 100644 --- a/test/using_bundler/Gemfile.lock +++ b/test/using_bundler/Gemfile.lock @@ -1,84 +1,105 @@ GEM remote: https://rubygems.org/ specs: - actionview (7.0.6) - activesupport (= 7.0.6) + actionview (8.0.2.1) + activesupport (= 8.0.2.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (7.0.6) - concurrent-ruby (~> 1.0, >= 1.0.2) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activesupport (8.0.2.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - ast (2.4.2) - better_html (2.0.2) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + ast (2.4.3) + base64 (0.3.0) + benchmark (0.4.1) + better_html (2.1.1) actionview (>= 6.0) activesupport (>= 6.0) ast (~> 2.0) erubi (~> 1.4) parser (>= 2.4) smart_properties - builder (3.2.4) - concurrent-ruby (1.2.2) + bigdecimal (3.2.3) + builder (3.3.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) crass (1.0.6) - erb_lint (0.4.0) + drb (2.2.3) + erb_lint (0.9.0) activesupport better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow - rubocop + rubocop (>= 1) smart_properties - erubi (1.12.0) - i18n (1.14.1) + erubi (1.13.1) + i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.6.3) - language_server-protocol (3.17.0.3) - loofah (2.21.3) + json (2.13.2) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.24.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) - minitest (5.18.1) - nokogiri (1.15.2-arm64-darwin) + minitest (5.25.5) + nokogiri (1.18.9-arm64-darwin) racc (~> 1.4) - nokogiri (1.15.2-x86_64-linux) + nokogiri (1.18.9-x86_64-linux-gnu) racc (~> 1.4) - parallel (1.23.0) - parser (3.2.2.3) + parallel (1.27.0) + parser (3.3.9.0) ast (~> 2.4.1) racc - racc (1.7.1) - rails-dom-testing (2.1.1) + prism (1.4.0) + racc (1.8.1) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) rainbow (3.1.1) - regexp_parser (2.8.1) - rexml (3.2.5) - rubocop (1.54.0) + regexp_parser (2.11.2) + rubocop (1.80.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.46.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.46.0) + parser (>= 3.3.7.2) + prism (~> 1.4) ruby-progressbar (1.13.0) + securerandom (0.4.1) smart_properties (1.17.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) + unicode-display_width (3.1.5) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.3) PLATFORMS arm64-darwin-20 + arm64-darwin-24 x86_64-linux DEPENDENCIES