@allons-y/actions-file-diff 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +385 -0
- package/README.md +282 -2
- package/action.yml +80 -0
- package/dist/index.js +30888 -0
- package/package.json +97 -5
- package/src/changes.js +372 -0
- package/src/index.js +18 -0
- package/src/page.js +472 -0
- package/src/publish.js +171 -0
- package/src/render.js +191 -0
- package/src/report-page.client.js +398 -0
- package/src/report-page.css +1115 -0
- package/src/report.js +515 -0
- package/src/utilities.js +141 -0
package/action.yml
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: File comparisons
|
|
2
|
+
description: Compares files between branches and reports size changes back on the pull request.
|
|
3
|
+
author: castastrophe
|
|
4
|
+
branding:
|
|
5
|
+
icon: bar-chart-2
|
|
6
|
+
color: blue
|
|
7
|
+
|
|
8
|
+
inputs:
|
|
9
|
+
head-path:
|
|
10
|
+
description: Path to file or directory for file sizes analysis.
|
|
11
|
+
required: false
|
|
12
|
+
default: ${{ github.workspace }}
|
|
13
|
+
base-path:
|
|
14
|
+
description: Optional path to another directory to perform file size diff against the provided path.
|
|
15
|
+
required: false
|
|
16
|
+
token:
|
|
17
|
+
description: GITHUB_TOKEN for the repository.
|
|
18
|
+
required: false
|
|
19
|
+
default: ${{ github.token }}
|
|
20
|
+
file-glob-pattern:
|
|
21
|
+
description: Glob pattern for filtering of the files.
|
|
22
|
+
required: false
|
|
23
|
+
default: "**/dist/**"
|
|
24
|
+
comment:
|
|
25
|
+
description: Whether to comment on the PR.
|
|
26
|
+
required: false
|
|
27
|
+
default: "true"
|
|
28
|
+
comment-header:
|
|
29
|
+
description: Comment header to be used in the PR comment. Also identifies the sticky comment, so distinct headers allow multiple instances to coexist.
|
|
30
|
+
required: false
|
|
31
|
+
default: "## File metrics"
|
|
32
|
+
build-dir:
|
|
33
|
+
description: Path segment separating a package from its built output. Files are grouped into a package named by the directory immediately before this segment; the readable filename is the path after it.
|
|
34
|
+
required: false
|
|
35
|
+
default: "dist"
|
|
36
|
+
main-file:
|
|
37
|
+
description: Fallback filename (relative to the build dir) treated as a package's main file.
|
|
38
|
+
required: false
|
|
39
|
+
default: "index.js"
|
|
40
|
+
read-package-json:
|
|
41
|
+
description: When true, use the `main` field of a package's package.json (relative to the build dir) as its main file instead of `main-file`.
|
|
42
|
+
required: false
|
|
43
|
+
default: "true"
|
|
44
|
+
extensions:
|
|
45
|
+
description: Optional list (multiline or comma-separated) of base extensions to report and count, e.g. `css, js`. `.map`, `.gz` and `.min` layers are stripped before comparing. Empty reports all files.
|
|
46
|
+
required: false
|
|
47
|
+
default: ""
|
|
48
|
+
|
|
49
|
+
visual-diff:
|
|
50
|
+
description: "Where to publish the visual diff (size chart, line diffs and changed images) linked from the comment. Line diffs need git on the PATH. `summary` writes collapsible sections to the job summary and links the run. `branch` also commits a tabbed HTML page to `report-branch` (needs contents write permission and GitHub Pages). `none` turns it off."
|
|
51
|
+
required: false
|
|
52
|
+
default: "summary"
|
|
53
|
+
report-branch:
|
|
54
|
+
description: Branch the HTML report is committed to when `visual-diff` is `branch`. Created as an orphan branch when missing, and kept to a single commit.
|
|
55
|
+
required: false
|
|
56
|
+
default: "file-diff-reports"
|
|
57
|
+
pages-url:
|
|
58
|
+
description: Base URL that serves `report-branch`. Defaults to the repository's GitHub Pages URL.
|
|
59
|
+
required: false
|
|
60
|
+
default: ""
|
|
61
|
+
max-diff-size:
|
|
62
|
+
description: Largest file (in bytes) that gets a line diff. Larger files are listed without one.
|
|
63
|
+
required: false
|
|
64
|
+
default: "262144"
|
|
65
|
+
max-diff-lines:
|
|
66
|
+
description: Most diff lines kept for the whole report. A diff that would go over is left out of the report, with its line counts kept.
|
|
67
|
+
required: false
|
|
68
|
+
default: "20000"
|
|
69
|
+
|
|
70
|
+
outputs:
|
|
71
|
+
has-changed:
|
|
72
|
+
description: '"true" when the head total differs from the base total; "false" otherwise, including when there is no base.'
|
|
73
|
+
total-size:
|
|
74
|
+
description: Integer byte total of the head, summing all reported files and using the minified size where one exists.
|
|
75
|
+
report-url:
|
|
76
|
+
description: "Link to the visual diff: the published page, or the workflow run's summary. Empty when `visual-diff` is `none` or outside a runner."
|
|
77
|
+
|
|
78
|
+
runs:
|
|
79
|
+
using: node24
|
|
80
|
+
main: dist/index.js
|