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

https://github.com/hakadoriya/gh-xz

gh-xz is a gh command eXtension for utilitieZ.
https://github.com/hakadoriya/gh-xz

gh gh-extension

Last synced: 2 months ago
JSON representation

gh-xz is a gh command eXtension for utilitieZ.

Awesome Lists containing this project

README

          

# [`gh-xz`](https://github.com/hakadoriya/gh-xz)

`gh-xz` is a gh command e**X**tension for utilitie**Z**.

## Installation

```sh
# install
gh extension install https://github.com/hakadoriya/gh-xz

# now you can use `gh xz`
gh xz
```

## Features

### `get-anchored-comment`

Get a comment that has a specific anchor string in a pull request.

```console
$ gh xz get-anchored-comment owner/repo 123 anchor1
This anchored comment is posted by gh-xz.

```

### `put-anchored-comment`

Put a comment that has a specific anchor string in a issue or pull request.

```console
$ gh xz put-anchored-comment owner/repo 123 anchor1 "This anchored comment is posted by gh-xz."

$ gh xz get-anchored-comment owner/repo 123 anchor1
This anchored comment is posted by gh-xz.

$ gh xz put-anchored-comment owner/repo 123 anchor1 "UPDATED by gh-xz."

$ gh xz get-anchored-comment owner/repo 123 anchor1
UPDATED by gh-xz.

```

## Usage

```console
$ gh xz
gh-xz - gh command eXtension to utilitieZ.

Usage:
gh-xz

SUBCOMMAND:
get-anchored-comment
Get a comment that has a specific anchor string in a issue or pull request.
Usage:
gh-xz get-anchored-comment
e.g.:
gh-xz get-anchored-comment owner/repo 123 "anchor"
put-anchored-comment
Put a comment that has a specific anchor string in a issue or pull request.
Usage:
gh-xz put-anchored-comment
e.g.:
gh-xz put-anchored-comment owner/repo 123 "anchor" "This anchored comment is posted by gh-xz."
gh-xz put-anchored-comment owner/repo 123 "anchor" @./comment.md
cat ./comment.md | gh-xz put-anchored-comment owner/repo 123 "anchor" @-
help, usage
Show this help message.
Usage:
gh-xz help
```

## GitHub Actions

[`hakadoriya-actions/setup-gh-xz`](https://github.com/hakadoriya-actions/setup-gh-xz) is a GitHub Actions to install `gh-xz` in GitHub Actions.

### Example

```yaml
name: example

on:
pull_request:

jobs:
example:
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: hakadoriya-actions/setup-gh-xz@v0.0.1
- name: Run gh xz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
gh xz put-anchored-comment ${{ github.repository }} ${{ github.event.number }} anchor1 "This anchored comment is posted by gh-xz."
```