Skip to content

Commit 3943b33

Browse files
authored
Merge pull request #835 from reviewdog/introduce-bundle-script
introduce bundle script
2 parents 05d0225 + 575ba31 commit 3943b33

26 files changed

+84660
-187627
lines changed

.github/workflows/check-dist.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# In TypeScript actions, `dist/` is a special directory. When you reference
2+
# an action with the `uses:` property, `dist/index.js` is the code that will be
3+
# run. For this project, the `dist/index.js` file is transpiled from other
4+
# source files. This workflow ensures the `dist/` directory contains the
5+
# expected transpiled code.
6+
#
7+
# If this workflow is run from a feature branch, it will act as an additional CI
8+
# check and fail if the checked-in `dist/` directory does not match what is
9+
# expected from the build.
10+
name: Check dist/
11+
12+
on:
13+
push:
14+
branches:
15+
- main
16+
paths-ignore:
17+
- "**.md"
18+
pull_request:
19+
paths-ignore:
20+
- "**.md"
21+
workflow_dispatch:
22+
23+
jobs:
24+
check-dist:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
30+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
31+
with:
32+
node-version-file: ".node-version"
33+
cache: "npm"
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Rebuild the dist/ directory
39+
run: |
40+
npm run bundle
41+
42+
- name: Compare the expected and actual dist/ directories
43+
run: |
44+
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
45+
echo "Detected uncommitted changes after build. See status below:"
46+
git diff
47+
exit 1
48+
fi
49+
id: diff
50+
51+
# If index.js was different than expected, upload the expected version as an artifact
52+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
53+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
54+
with:
55+
name: dist
56+
path: dist/

.github/workflows/reviewdog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163

164164
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
165165
with:
166-
node-version-file: "package.json"
166+
node-version-file: ".node-version"
167167
cache: "npm"
168168
- run: npm ci
169169
- uses: reviewdog/action-eslint@556a3fdaf8b4201d4d74d406013386aa4f7dab96 # v1.34.0

.github/workflows/test.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,9 @@ jobs:
1818
- name: Set up Node.js
1919
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2020
with:
21-
node-version-file: "package.json"
21+
node-version-file: ".node-version"
2222
cache: npm
2323
- name: Install Dependencies
2424
run: npm ci
2525
- name: Run Test
2626
run: npm run test
27-
- name: Ensure dist/ folder is up-to-date
28-
if: ${{ runner.os == 'Linux' }}
29-
shell: bash
30-
run: |
31-
npm run package
32-
if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
33-
echo "Detected uncommitted changes after build. See status below:"
34-
git diff
35-
exit 1
36-
fi

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24.13.0

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"printWidth": 120
2+
"printWidth": 120
33
}

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ inputs:
3434
Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level.
3535
Possible values: [none,any,info,warning,error]
3636
Default is `none`.
37-
default: 'none'
37+
default: "none"
3838
fail_on_error:
3939
description: |
4040
Deprecated, use `fail_level` instead.
@@ -72,7 +72,7 @@ inputs:
7272

7373
runs:
7474
using: "node24"
75-
main: "dist/index.cjs"
75+
main: "dist/index.js"
7676
branding:
7777
icon: "check-circle"
7878
color: "blue"

dist/cache.js

Lines changed: 0 additions & 91 deletions
This file was deleted.

dist/flags.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)