Skip to content

Commit

Permalink
docs: Add docs for new install-script option
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Orozco <[email protected]>
  • Loading branch information
rschristian and alanorozco committed Apr 22, 2024
1 parent 88a81a1 commit 78fbd4d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ jobs:
- uses: preactjs/compressed-size-action@v2
```
### Customizing the Installation
By default, `compressed-size-action` will install dependencies according to which lockfiles are present, if any. However, if you need to run a different installation command, you can pass a custom script to do so. For example, to use `npm ci` with the `--workspace` option:

```diff
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: preactjs/compressed-size-action@v2
with:
+ install-script: "npm ci --workspace=packages/my-subpackage"
```

### Customizing the Build

By default, `compressed-size-action` will try to build your PR by running the `"build"` [npm script](https://docs.npmjs.com/misc/scripts) in your `package.json`.
Expand Down

0 comments on commit 78fbd4d

Please sign in to comment.