Skip to main content

gh-issue-delete-comment

info

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

The gh-issue-delete-comment step removes a comment from a GitHub issue or pull request. It is typically used in if: ${{ failure() }} cleanup steps to remove progress comments posted by a gh-issue-add-comment step, 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 delete. Typically from gh-issue-add-comment output, but any valid GitHub comment ID may be provided.

Output

This step does not produce any output.

Example

This example deletes a progress comment if the promotion fails:

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-delete-comment
if: ${{ failure() && status('post-comment') == 'Succeeded' }}
config:
repoURL: https://github.com/myorg/myrepo
commentID: ${{ outputs['post-comment'].commentID }}