Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/conormacbride/gh-serve
Serve GitHub Actions HTML artifacts locally 🌍
https://github.com/conormacbride/gh-serve
artifact ci gh-extension github github-actions go golang html web
Last synced: 20 days ago
JSON representation
Serve GitHub Actions HTML artifacts locally 🌍
- Host: GitHub
- URL: https://github.com/conormacbride/gh-serve
- Owner: ConorMacBride
- License: mit
- Created: 2023-04-01T23:19:57.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-02T11:46:44.000Z (almost 2 years ago)
- Last Synced: 2024-11-09T10:52:43.245Z (3 months ago)
- Topics: artifact, ci, gh-extension, github, github-actions, go, golang, html, web
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# gh-serve
Serve GitHub Actions HTML artifacts locally 🌍
**gh-serve** is a [GitHub CLI](https://cli.github.com) extension that finds GitHub Actions artifacts for the current PR, or branch, and serves them on a local web server.
This allows you to quickly preview HTML artifacts, such as CI test reports or documentation websites.## Installation
```
gh extension install ConorMacBride/gh-serve
```Upgrade:
```
gh extension upgrade gh-serve
```## Usage
Navigate to a GitHub repository, and run:
```
gh serve
```It will find artifacts for GitHub Actions workflow runs for the latest commit to the current open PR, or branch.
If there are multiple artifacts, an interactive menu will appear, allowing you to select the one to serve.
The artifact will be hosted at `http://localhost:8080/`.Available flags:
```text
--no-browser don't open the artifact in your default browser
--no-cache don't use cached artifacts
--port string port to serve the artifact on (default "8080")
-h, --help show help for command
```## How it works
1. 🔎 Finds GitHub Actions workflow runs for the current PR, or branch
- Only finds runs for the *latest* remote commit
- If the current branch has an open PR, prefer `pull_request` events
2. 📝 Lists all the artifacts for the workflow runs
- Interactively select the artifact to serve, if there are multiple
3. 💾 Downloads the artifact
- Caches in `/.cache/gh-serve///`
- Ignore cache with `--no-cache`
4. 🌍 Serves the artifact on a local web server
- Default port is `8080`
- Change port with `--port `
5. 👀 Opens the artifact in your default browser
- Skip with `--no-browser`