Skip to content

Commit 4e9a28d

Browse files
authored
Merge pull request #3 from codeur/remove-release-script
Remove bin/release
2 parents bf05e9d + 9c125e6 commit 4e9a28d

File tree

9 files changed

+160
-132
lines changed

9 files changed

+160
-132
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
env:
1111
BUNDLE_GEMFILE: ${{ github.workspace }}/test/using_bundler/Gemfile
1212
steps:
13-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14-
- uses: ruby/setup-ruby@922ebc4c5262cd14e07bb0e1db020984b6c064fe # v1.226.0
13+
- uses: actions/checkout@v6
14+
- uses: ruby/setup-ruby@v1
1515
with:
1616
ruby-version: 3.4
1717
bundler-cache: true
@@ -21,5 +21,7 @@ jobs:
2121
github_token: ${{ secrets.github_token }}
2222
skip_install: 'true'
2323
use_bundler: 'true'
24+
reporter: github-pr-annotations
25+
fail_level: warning
2426
- run: |
2527
test "$(bundle exec erb_lint --version)" == "0.9.0"

.github/workflows/depup.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
name: depup
22
on:
33
schedule:
4-
- cron: "14 14 * * *" # Runs at 14:14 UTC every day
4+
- cron: '14 14 * * *' # Runs at 14:14 UTC every day
55
repository_dispatch:
66
types: [depup]
77

88
jobs:
99
reviewdog:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13-
- uses: haya14busa/action-depup@d6b40096afad49ca676145faaba7190df29a9807 # v1.6.3
12+
- uses: actions/checkout@v6
13+
- uses: reviewdog/action-depup@v1
1414
id: depup
1515
with:
1616
file: action.yml
1717
version_name: REVIEWDOG_VERSION
1818
repo: reviewdog/reviewdog
1919

2020
- name: Create Pull Request
21-
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
21+
uses: peter-evans/create-pull-request@v6
2222
with:
2323
token: ${{ secrets.GITHUB_TOKEN }}
2424
title: "chore(deps): update reviewdog to ${{ steps.depup.outputs.latest }}"

.github/workflows/release.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- main
66
tags:
7-
- "v*.*.*"
7+
- 'v*.*.*'
88
pull_request:
99
types:
1010
- labeled
@@ -14,35 +14,34 @@ jobs:
1414
if: github.event.action != 'labeled'
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
- uses: actions/checkout@v6
1818

1919
# Bump version on merging Pull Requests with specific labels.
2020
# (bump:major,bump:minor,bump:patch)
2121
- id: bumpr
2222
if: "!startsWith(github.ref, 'refs/tags/')"
23-
uses: haya14busa/action-bumpr@78ab5a104d20896c9c9122c64221b3aecf1a8cbb # v1.10.0
23+
uses: haya14busa/action-bumpr@v1
2424

2525
# Update corresponding major and minor tag.
2626
# e.g. Update v1 and v1.2 when releasing v1.2.3
27-
- uses: haya14busa/action-update-semver@fb48464b2438ae82cc78237be61afb4f461265a1 # v1.2.1
27+
- uses: haya14busa/action-update-semver@v1
2828
if: "!steps.bumpr.outputs.skip"
2929
with:
3030
tag: ${{ steps.bumpr.outputs.next_version }}
3131

3232
# Get tag name.
3333
- id: tag
34-
uses: haya14busa/action-cond@94f77f7a80cd666cb3155084e428254fea4281fd # v1.2.1
34+
uses: haya14busa/action-cond@v1
3535
with:
3636
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
3737
if_true: ${{ github.ref }}
3838
if_false: ${{ steps.bumpr.outputs.next_version }}
3939

40-
# Create release
40+
# Create release.
4141
- if: "steps.tag.outputs.value != ''"
4242
env:
4343
TAG_NAME: ${{ steps.tag.outputs.value }}
4444
BODY: ${{ steps.bumpr.outputs.message }}
45-
# This token is provided by Actions, you do not need to create your own token
4645
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4746
run: |
4847
gh release create "${TAG_NAME}" -t "Release ${TAG_NAME/refs\/tags\//}" --notes "${BODY}"
@@ -51,6 +50,6 @@ jobs:
5150
if: github.event.action == 'labeled'
5251
runs-on: ubuntu-latest
5352
steps:
54-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
- uses: actions/checkout@v6
5554
- name: Post bumpr status comment
56-
uses: haya14busa/action-bumpr@78ab5a104d20896c9c9122c64221b3aecf1a8cbb # v1.10.0
55+
uses: haya14busa/action-bumpr@v1

.github/workflows/reviewdog.yml

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,66 @@
11
name: reviewdog
22
on: [pull_request]
3+
34
jobs:
4-
# Use shellcheck to lint shell scripts
5-
shellcheck:
6-
name: runner / shellcheck
5+
misspell:
6+
name: check / misspell
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
10-
- name: shellcheck
11-
uses: reviewdog/action-shellcheck@6e0e63d1750d02d761b3df0f2c5ba9f9ac4a9ed7 # v1.29.0
9+
- uses: actions/checkout@v6
10+
- name: misspell
11+
uses: reviewdog/action-misspell@v1
1212
with:
1313
github_token: ${{ secrets.github_token }}
14+
reporter: github-pr-annotations
15+
fail_level: any
16+
locale: "US"
1417

15-
# Use misspell to correct spelling mistakes
16-
misspell:
17-
name: runner / misspell
18+
shellcheck:
19+
name: runner / shellcheck
1820
runs-on: ubuntu-latest
1921
steps:
20-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21-
- name: misspell
22-
uses: reviewdog/action-misspell@18ffb61effb93b47e332f185216be7e49592e7e1 # v1.26.1
22+
- uses: actions/checkout@v6
23+
- name: shellcheck
24+
uses: reviewdog/action-shellcheck@v1
2325
with:
2426
github_token: ${{ secrets.github_token }}
25-
locale: "US"
27+
reporter: github-pr-annotations
28+
fail_level: any
29+
path: "."
30+
pattern: "*.sh"
31+
exclude: "./.git/*"
2632

27-
# Use yamllint to lint yaml files
2833
yamllint:
2934
name: check / yamllint
3035
runs-on: ubuntu-latest
3136
steps:
32-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
- uses: actions/checkout@v6
3338
- name: yamllint
34-
uses: reviewdog/action-yamllint@1dca3ad811867be18fbe293a9818d715a6c2cd46 # v1.20.0
39+
uses: reviewdog/action-yamllint@v1
3540
with:
3641
github_token: ${{ secrets.github_token }}
37-
reporter: github-pr-review
42+
reporter: github-pr-annotations
3843
fail_level: any
3944
yamllint_flags: '-d "{extends: default, rules: {truthy: disable}}" .'
45+
46+
actionlint:
47+
name: runner / actionlint
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v6
51+
- uses: reviewdog/action-actionlint@v1
52+
with:
53+
reporter: github-pr-annotations
54+
fail_level: error
55+
level: warning
56+
57+
alex:
58+
name: runner / alex
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v6
62+
- uses: reviewdog/action-alex@v1
63+
with:
64+
reporter: github-pr-annotations
65+
fail_level: error
66+
level: warning

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Wizard Health
3+
Copyright (c) 2023 Wizard Health, codeur
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# GitHub Action: Run erb_lint with reviewdog 🐶
22

33
[![](https://img.shields.io/github/license/codeur/action-erblint)](./LICENSE)
4+
[![reviewdog](https://github.com/codeur/action-erblint/workflows/reviewdog/badge.svg)](https://github.com/codeur/action-erblint/actions?query=workflow%3Areviewdog)
45
[![depup](https://github.com/codeur/action-erblint/workflows/depup/badge.svg)](https://github.com/codeur/action-erblint/actions?query=workflow%3Adepup)
56
[![release](https://github.com/codeur/action-erblint/workflows/release/badge.svg)](https://github.com/codeur/action-erblint/actions?query=workflow%3Arelease)
67
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/codeur/action-erblint?logo=github&sort=semver)](https://github.com/codeur/action-erblint/releases)
@@ -30,18 +31,17 @@ With `reporter: github-pr-review` a comment is added to the Pull Request Convers
3031

3132
`GITHUB_TOKEN`. Default is `${{ github.token }}`.
3233

33-
### `erblint_version`
34+
### `erblint_flags`
35+
36+
Optional. erb_lint flags. (erb_lint --quiet --format tabs --no-exit-on-warn --no-exit-on-error `<erblint_flags>`)
3437

35-
Optional. Set erb_lint version.
38+
### `erblint_version`
3639

40+
Optional. Set erb_lint version. Possible values:
3741
- empty or omit: install latest version
3842
- `gemfile`: install version from Gemfile (`Gemfile.lock` should be presented, otherwise it will fallback to latest bundler version)
3943
- version (e.g. `0.9.0`): install said version
4044

41-
### `erblint_flags`
42-
43-
Optional. erb_lint flags. (erb_lint --quiet --format tabs --no-exit-on-warn --no-exit-on-error `<erblint_flags>`)
44-
4545
### `tool_name`
4646

4747
Optional. Tool name to use for reviewdog reporter. Useful when running multiple
@@ -57,6 +57,17 @@ It's same as `-level` flag of reviewdog.
5757
Optional. Reporter of reviewdog command [`github-pr-check`, `github-pr-review`].
5858
The default is `github-pr-check`.
5959

60+
### `fail_level`
61+
62+
Optional. If set to `none`, always use exit code 0 for reviewdog. Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level.
63+
Possible values: [`none`, `any`, `info`, `warning`, `error`].
64+
Default is `none`.
65+
66+
### `fail_on_error`
67+
68+
Optional. Deprecated, use `fail_level` instead. Exit code for reviewdog when errors are found [`true`, `false`].
69+
Default is `false`.
70+
6071
### `filter_mode`
6172

6273
Optional. Filtering mode for the reviewdog command [`added`, `diff_context`, `file`, `nofilter`].
@@ -66,10 +77,6 @@ Default is `added`.
6677

6778
Optional. Additional reviewdog flags.
6879

69-
### `workdir`
70-
71-
Optional. The directory from which to look for and run erb_lint. Default `.`.
72-
7380
### `skip_install`
7481

7582
Optional. Do not install erb_lint. Default: `false`.
@@ -78,9 +85,13 @@ Optional. Do not install erb_lint. Default: `false`.
7885

7986
Optional. Run erb_lint with bundle exec. Default: `false`.
8087

88+
### `workdir`
89+
90+
Optional. The directory from which to look for and run erb_lint. Default `.`.
91+
8192
## Example usage
8293

83-
```yml
94+
```yaml
8495
name: reviewdog
8596
on: [pull_request]
8697
jobs:
@@ -89,18 +100,30 @@ jobs:
89100
runs-on: ubuntu-latest
90101
steps:
91102
- name: Check out code
92-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103+
uses: actions/checkout@v6
93104
- name: Set up Ruby
94-
uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0
105+
uses: ruby/setup-ruby@v1
95106
with:
96-
ruby-version: 3.4.5
107+
ruby-version: 3.4
97108
- name: erb_lint
98-
uses: codeur/action-erblint@5083efd49634e26645a0736681b618ccc3fb7f14 # v2.19.2
109+
uses: codeur/action-erblint@v2
99110
with:
100-
erblint_version: 0.9.0
101-
reporter: github-pr-review # Default is github-pr-check
111+
erblint_version: gemfile
112+
reporter: github-pr-review
102113
```
103114
115+
## Dev
116+
117+
### Release new version
118+
119+
1. Create a Pull Request with changes.
120+
2. Add one of the following labels to the PR:
121+
- `bump:major`: Bump major version (e.g. v1.0.0 -> v2.0.0)
122+
- `bump:minor`: Bump minor version (e.g. v1.0.0 -> v1.1.0)
123+
- `bump:patch`: Bump patch version (e.g. v1.0.0 -> v1.0.1)
124+
3. Merge the PR.
125+
4. The release workflow will automatically bump the version, create a release, and update major/minor tags (e.g. v1).
126+
104127
## License
105128

106129
[MIT](https://choosealicense.com/licenses/mit)

0 commit comments

Comments
 (0)