Skip to main content

gh-issue-update-comment

info

This promotion step is only available in Kargo on the Akuity Platform, versions v1.11.0 and above.

The gh-issue-update-comment step replaces the body of an existing comment on a GitHub issue or pull request. The commentID is typically sourced from a gh-issue-add-comment step output in the same stage, but any valid GitHub comment ID may be provided.

GitHub Issues integration for Kargo is a group of promotion steps:

  1. gh-issue-add-comment
  2. gh-create-issue
  3. gh-issue-delete-comment
  4. gh-search-issues
  5. gh-issue-update-comment
  6. gh-update-issue
  7. gh-wait-for-issue-state

Credentials

These steps use the same repository credentials that git-clone and git-open-pr use for the same repository. If you have already configured a Git credential for the repoURL, no additional setup is required.

The GitHub token must have Issues: Read and write access for the repository (or the repo scope for a classic personal access token).

Configuration

NameTypeRequiredDescription
repoURLstringYThe URL of the GitHub repository (e.g. https://github.com/owner/repo).
insecureSkipTLSVerifybooleanNIf true, TLS verification of the GitHub server certificate is skipped. Use only for GitHub Enterprise Server instances with self-signed certificates.
commentIDintegerYThe ID of the comment to update. Typically from gh-issue-add-comment output, but any valid GitHub comment ID may be provided.
bodystringYThe new body text of the comment. Replaces the existing body. Supports GitHub Flavored Markdown.

Output

NameTypeDescription
commentIDintegerThe ID of the updated comment (same value passed as input, echoed for convenience).
urlstringThe HTML URL of the updated comment.

Example

This example posts a "promotion started" comment and then updates it with the final outcome:

steps:
- as: post-comment
uses: gh-issue-add-comment
config:
repoURL: https://github.com/myorg/myrepo
issueNumber: ${{ freightMetadata(ctx.targetFreight.name)['github-issue-number'] }}
body: "Promotion to **${{ ctx.stage }}** is in progress..."

# ... your promotion steps ...

- uses: gh-issue-update-comment
config:
repoURL: https://github.com/myorg/myrepo
commentID: ${{ outputs['post-comment'].commentID }}
body: "Promotion to **${{ ctx.stage }}** completed successfully."