Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonireilly/observatory-github-action
Run https://observatory.mozilla.org/ against pull requests and preview URLs
https://github.com/simonireilly/observatory-github-action
Last synced: 3 months ago
JSON representation
Run https://observatory.mozilla.org/ against pull requests and preview URLs
- Host: GitHub
- URL: https://github.com/simonireilly/observatory-github-action
- Owner: simonireilly
- License: mit
- Created: 2020-11-16T17:20:36.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-19T00:51:01.000Z (over 1 year ago)
- Last Synced: 2024-08-28T15:45:58.682Z (4 months ago)
- Language: TypeScript
- Homepage: observatory-github-action-git-main.simonireilly.vercel.app
- Size: 2.02 MB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Observatory GitHub Action
Run the [Mozilla Observatory](https://observatory.mozilla.org/) in CI/CD for any website.
![GitHub comment showing output from observatory report](.readme/example.png)
- [Observatory GitHub Action](#observatory-github-action)
- [About](#about)
- [Detailed Examples](#detailed-examples)
- [Static URL on Pull Requests](#static-url-on-pull-requests)
- [Deployment Status for Preview Environments](#deployment-status-for-preview-environments)
- [Contributing](#contributing)
- [Releasing](#releasing)
- [Powered By](#powered-by)## About
This action is a light wrapper around [mozilla/observatory-cli](https://github.com/mozilla/observatory-cli) that returns a markdown string.
It can be used in conjunction with other comment based actions to add PR comments.
## Detailed Examples
The github workflows folder contain detailed examples
### Static URL on Pull Requests
```yaml
# examples/workflows/static-url.ymlname: "branch"
on:
pull_request:jobs:
static-url:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3- name: Test Observatory
uses: simonireilly/[email protected]
id: observatory
with:
web_host: https://hungry-borg-990e06.netlify.app- name: Create commit comment
uses: peter-evans/commit-comment@v1
with:
body: "# Branch PR ${{ steps.observatory.outputs.observatory-report }}"
```![GitHub comment showing output from observatory report](.readme/static-url.png)
### Deployment Status for Preview Environments
This method will work for Preview deploys that use the GitHub deployments API. It supports [https://vercel.com/](https://vercel.com/) preview Urls.
```yaml
# examples/workflows/deployment_status.ymlname: "deployment-status"
on:
deployment_status:jobs:
deployment_status:
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
steps:
- uses: actions/checkout@v3- name: Test Observatory
uses: simonireilly/[email protected]
id: observatory- name: Create commit comment
uses: peter-evans/commit-comment@v1
with:
body: "# Deployment Status _${{ github.event.deployment_status.state }}_ ${{ steps.observatory.outputs.observatory-report }}"
```![GitHub comment showing output from observatory report](.readme/deployment-status.png)
## Contributing
Fork the repository and create a MR against the upstream.
### Releasing
To release, with master branch checked out run:
```bash
yarn pub:beta
```If this is to be a latest release run:
```bash
yarn pub:latest
```Keep the changelog up to date between merge releases with:
```markdown
## [Unchanged]
```## Powered By
- [HTTP Observatory](https://github.com/mozilla/http-observatory) by April King
- [HTTP Observatory CLI](https://github.com/mozilla/observatory-cli) by April King