Skip to main content

gh-update-issue

info

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

The gh-update-issue step modifies an existing GitHub issue. At least one optional field (title, body, state, addLabels, removeLabels, or assignees) must be set — the step will fail validation if only repoURL and issueNumber are 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.
issueNumberintegerYThe number of the issue to update.
titlestringNNew title for the issue.
bodystringNNew body text for the issue. Supports GitHub Flavored Markdown. Pass an empty string ("") to clear the existing body.
statestringNSet the issue state to open or closed.
addLabels[]stringNLabels to add to the issue. Labels must already exist in the repository.
removeLabels[]stringNLabels to remove from the issue. Pass ["*"] to remove all existing labels (any other entries in the list are ignored when "*" is present).
assignees[]stringNReplace the issue's assignee list with these GitHub usernames. Pass an empty list to remove all assignees. GitHub allows a maximum of 10 assignees per issue; entries beyond 10 are silently ignored.
info

addLabels and removeLabels are computed against the issue's current label set, so they can be used together safely. If the same label appears in both lists, the add takes precedence. Pass ["*"] in removeLabels to clear all existing labels; any labels in addLabels are then applied on top of the empty set.

Output

This step does not produce any output.

Example

This example closes an issue and adds a released label when promotion to production succeeds:

steps:
# ... your promotion steps ...

- uses: gh-update-issue
config:
repoURL: https://github.com/myorg/myrepo
issueNumber: ${{ freightMetadata(ctx.targetFreight.name)['github-issue-number'] }}
state: closed
addLabels:
- released
- "env-prod"
removeLabels:
- "env-staging"