You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,25 @@ jobs:
115
115
}
116
116
```
117
117
118
+
### Sorting the list of files
119
+
120
+
By default, the results table is sorted by filename in ascending order. You can customize this behavior using the `order-by` option:
121
+
122
+
```diff
123
+
name: Compressed Size
124
+
on: [pull_request]
125
+
jobs:
126
+
build:
127
+
runs-on: ubuntu-latest
128
+
steps:
129
+
- uses: actions/checkout@v2
130
+
- uses: preactjs/compressed-size-action@v2
131
+
with:
132
+
+ order-by: "Size:desc"
133
+
```
134
+
135
+
The format is "column:direction", where column is one of "Filename", "Size", or "Change" and direction is "asc" or "desc". For example, "Size:desc" sorts the table by file size in descending order.
136
+
118
137
### Customizing the list of files
119
138
120
139
`compressed-size-action` defaults to tracking the size of all JavaScript files within `dist/` directories - anywhere in your repository, not just at the root. You can change the list of files to be tracked and reported using the `pattern` and `exclude` options, both of which are [minimatch patterns](https://github.com/motemen/minimatch-cheat-sheet/blob/master/README.md):
Copy file name to clipboardExpand all lines: action.yml
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,9 @@ inputs:
42
42
description: 'A custom working directory to execute the action in relative to repo root (defaults to .)'
43
43
comment-key:
44
44
description: 'Optional key to include in the bot comment to allow for multiple bundle calculations to be posted in separate comments.'
45
+
sort-by:
46
+
description: 'The column and direction to sort the results by. The format is "column:direction", where column is one of "Filename", "Size", or "Change" and direction is "asc" or "desc". For example, "Size:desc" sorts the table by file size in descending order.'
0 commit comments