Created
March 2, 2026 05:57
-
-
Save fizz/57a6e1a18475259b169ebc21259fd49e to your computer and use it in GitHub Desktop.
jira-comment — pipe-safe comment wrapper for go-jira. Accepts body via stdin, no shell escaping needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # jira-comment — pipe-safe comment wrapper for go-jira | |
| # | |
| # Accepts comment body via stdin so you never need to shell-escape | |
| # quotes, backticks, URLs, or Atlassian [~accountid:] mentions. | |
| # | |
| # Usage: | |
| # echo "looks good, merging" | jira-comment NA-393 | |
| # jira-comment NA-393 <<'EOF' | |
| # Multi-line comment with "quotes" and `backticks` | |
| # and [~accountid:abc123] mentions | |
| # EOF | |
| # | |
| # Requires: go-jira (https://github.com/go-jira/jira) | |
| set -euo pipefail | |
| ticket="${1:?Usage: jira-comment TICKET <<< 'comment body'}" | |
| body="$(cat)" | |
| [[ -z "$body" ]] && { echo "Error: empty comment body" >&2; exit 1; } | |
| exec jira comment "$ticket" --noedit -m "$body" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment