Skip to main content

gh-wait-for-issue-state

info

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

The gh-wait-for-issue-state step polls a GitHub issue and holds the promotion until the issue meets a specified condition: a target state (open or closed) and/or the presence of a named label. At least one of state or label must be provided.

This is useful for human-in-the-loop approval workflows where a reviewer signals readiness by closing an issue or applying a label.

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 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 watch.
statestringNWait until the issue is in this state. Must be open or closed. At least one of state or label is required.
labelstringNWait until the issue has this label. At least one of state or label is required.
pollIntervalstringNHow often to check the issue state, specified as a Go duration string (e.g., 30s, 5m, 1.5h). Overrides the default controller reconciliation interval when set.

Output

This step does not produce any output.

Examples

Wait for label

Block promotion until a reviewer applies the approved label to signal readiness:

steps:
- uses: gh-wait-for-issue-state
config:
repoURL: https://github.com/myorg/myrepo
issueNumber: ${{ freightMetadata(ctx.targetFreight.name)['github-issue-number'] }}
label: approved
pollInterval: 2m

# Promotion continues once the label is present
- uses: argocd-update
config:
apps:
- name: prod-app
namespace: argocd

Wait for closed state

Block promotion until the issue is closed:

steps:
- uses: gh-wait-for-issue-state
config:
repoURL: https://github.com/myorg/myrepo
issueNumber: ${{ freightMetadata(ctx.targetFreight.name)['github-issue-number'] }}
state: closed

Wait for both label and closed state

Both conditions must be true simultaneously:

steps:
- uses: gh-wait-for-issue-state
config:
repoURL: https://github.com/myorg/myrepo
issueNumber: ${{ freightMetadata(ctx.targetFreight.name)['github-issue-number'] }}
state: closed
label: approved