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.
- Host: GitHub
- URL: https://github.com/hakadoriya/gh-xz
- Owner: hakadoriya
- License: apache-2.0
- Created: 2025-01-08T16:51:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-24T14:24:08.000Z (6 months ago)
- Last Synced: 2026-04-10T08:55:08.674Z (2 months ago)
- Topics: gh, gh-extension
- Language: Shell
- Homepage: https://github.com/hakadoriya/gh-xz
- Size: 62.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
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."
```