Skip to content

Commit

Permalink
Merge pull request #8 from exoego/permissions
Browse files Browse the repository at this point in the history
Document permissions
  • Loading branch information
exoego committed May 2, 2024
2 parents 612d3b5 + 69a2294 commit 66da76e
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,29 @@ Analyzes each PR's impact on esbuild bundle size
### Basic

```yaml
# Ensure you build your project before running this action
- name: Run esbuild
run: npm run build

# Call this action after the build
- name: Analyze esbuild bundle size
# uses: exoego/esbuild-bundle-analyzer@main # If you prefer nightly!
uses: exoego/esbuild-bundle-analyzer@v1
with:
metafiles: "out/meta.json"
permissions:
contents: read # for checkout repository
actions: read # for fetching base branch bundle stats
pull-requests: write # for comments

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
# ...
# (snip)
# ...
# Ensure you build your project before running this action
- name: Run esbuild
run: npm run build

# Call this action after the build
- name: Analyze esbuild bundle size
# uses: exoego/esbuild-bundle-analyzer@main # If you prefer nightly!
uses: exoego/esbuild-bundle-analyzer@v1
with:
metafiles: "out/meta.json"
```
As of esbuild v0.20.0, you need to [write
Expand All @@ -45,6 +58,17 @@ In this case, the `metafiles` input should be `"dist/meta.json"`.

If you have multiple meta files, you can specify them like this `"dist/meta1.json,dist/meta2.json"`.

## Permissions

This action requires the following permissions:

```yaml
permissions:
contents: read # for checkout repository
actions: read # for fetching base branch bundle stats
pull-requests: write # for comments
```
## Action inputs
| Name | Default | Description |
Expand Down

0 comments on commit 66da76e

Please sign in to comment.