Skip to content

Commit

Permalink
Merge pull request #17 from stefafafan/add-readme
Browse files Browse the repository at this point in the history
Add readme
  • Loading branch information
stefafafan authored Dec 22, 2022
2 parents dffc6c1 + 9b5269d commit bb2e9ef
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
<a href="https://github.com/stefafafan/psi-action/actions"><img alt="psi-action status" src="https://github.com/stefafafan/psi-action/workflows/build-test/badge.svg"></a>

# psi-action

TODO
psi-action is a GitHub Action that outputs [PageSpeed Insights](https://pagespeed.web.dev/) values for the next steps of a workflow. This action is similar to [JakePartusch/psi-action](https://github.com/JakePartusch/psi-action), but different in that this actually outputs the values for further use in the workflow.

## Inputs

- TODO
- `url`: The URL to fetch PageSpeed Insights results.
- `key`: API Key for the PageSpeed Insights API.
- `strategy`: Strategy to fetch PageSpeed Insights results. "mobile" or "desktop".

## Outputs

- TODO
- `score`: Overall score of the url. Maximum is 100.
- `first-contentful-paint`: First Contentful Paint (FCP) in milliseconds.
- `first-input-delay`: First Input Delay (FID) in milliseconds.
- `cumulative-layout-shift`: Cumulative Layout Shift (CLS) score.
- `largest-contentful-paint`: Largest Contentful Paint (LCP) in milliseconds.
- `speed-index`: Speed Index score. Maximum is 100.
- `time-to-interactive`: Time to Interactive score. Maximum is 100.
- `total-blocking-time`: Total Blocking Time score. Maximum is 100.

## Example Usage
TODO
```yaml
- id: psi
uses: stefafafan/psi-action@v1
with:
url: 'https://example.com/'
key: ${{ secrets.API_KEY }}
strategy: 'mobile'
- name: echo score
run: echo "Score: ${{ steps.psi.outputs.score }}"
```
## Contributing
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ outputs:
runs:
using: 'node16'
main: 'dist/index.js'
branding:
icon: 'trending-up'
color: 'blue'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "psi-action",
"version": "0.0.0",
"version": "1.0.0",
"private": true,
"description": "PageSpeed Insights Action",
"main": "lib/main.js",
Expand Down

0 comments on commit bb2e9ef

Please sign in to comment.