An open API service indexing awesome lists of open source software.

https://github.com/koki-develop/ghatree

🌲 Visualize GitHub Actions workflow dependencies as a tree structure.
https://github.com/koki-develop/ghatree

Last synced: about 2 months ago
JSON representation

🌲 Visualize GitHub Actions workflow dependencies as a tree structure.

Awesome Lists containing this project

README

          

[![NPM Version](https://img.shields.io/npm/v/ghatree)](https://www.npmjs.com/package/ghatree)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/koki-develop/ghatree/release-please.yml)](https://github.com/koki-develop/ghatree/actions/workflows/release-please.yml)
[![GitHub License](https://img.shields.io/github/license/koki-develop/ghatree)](./LICENSE)

# ghatree

![screenshot](./screenshot.png)

Visualize GitHub Actions workflow dependencies as a tree structure.

## Usage

You can run it with `npx`.

```bash
$ npx ghatree@latest
```

`ghatree` internally uses the GitHub REST API to retrieve GitHub Actions information.
You can set the token for the GitHub REST API using the `GITHUB_TOKEN` environment variable.

```bash
$ GITHUB_TOKEN= npx ghatree@latest
```

By default, `ghatree` outputs the GitHub Actions workflow dependencies for the repository in the current directory.
To specify a remote repository, use the `--repo` flag.

```bash
$ npx ghatree@latest --repo koki-develop/ghatree
```

To output in JSON format, use the `--json` flag.

```bash
$ npx ghatree@latest --json
```

Output Example

```json5
{
"type": "repository",
"repository": {
"owner": "koki-develop",
"name": "ghatree"
},
"dependencies": [
{
"type": "workflow",
"repository": {
"owner": "koki-develop",
"name": "ghatree"
},
"path": ".github/workflows/ci.yml",
"dependencies": [
{
"type": "job",
"name": "lint",
"dependencies": [
{
"type": "action",
"repository": {
"owner": "actions",
"name": "checkout"
},
"ref": "11bd71901bbe5b1630ceea73d27597364c9af683",
"dependencies": []
},
// ...
]
},
// ...
]
},
// ...
]
}
```

## License

[MIT](./LICENSE)