
GitHub Comment
CertifiedAdd or update an issue comment
GitHub Comment
Add or update an issue comment
Posts a comment on an existing GitHub issue or pull request. By default a new comment is created on each run. Set commentId to update a specific comment in place, or set updateTag to keep a single, continuously-updated comment (for example a test report that is refreshed on every run instead of piling up new comments). The authenticated token must be allowed to read the repository and comment on the issue.
type: io.kestra.plugin.github.issues.CommentExamples
Put a comment on an issue in a repository.
id: github_comment_on_issue_flow
namespace: company.team
tasks:
- id: comment_on_issue
type: io.kestra.plugin.github.issues.Comment
oauthToken: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
repository: kestra-io/kestra
issueNumber: 1347
body: "{{ execution.id }} has failed on {{ taskrun.startDate }}. See the link below for more details"
Keep a single, self-updating test report comment on a pull request. Using updateTag, the task looks for a previous comment carrying the same tag and updates it in place, otherwise it creates a new one.
id: github_report_test_results
namespace: company.team
tasks:
- id: report
type: io.kestra.plugin.github.issues.Comment
oauthToken: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
repository: kestra-io/kestra
issueNumber: 1347
updateTag: test-report
body: |
## Test report
{{ outputs.tests.report }}
Update a specific comment by its identifier.
id: github_update_comment
namespace: company.team
tasks:
- id: update_comment
type: io.kestra.plugin.github.issues.Comment
oauthToken: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
repository: kestra-io/kestra
issueNumber: 1347
commentId: 1234567890
body: "Updated at {{ now() }}"
Properties
issueNumber *Requiredintegerstring
Issue number
Numeric issue identifier within the repository. Pull requests share the same numbering as issues.
appInstallationToken string
GitHub App installation token
Installation access token generated by a GitHub App. Use this for repository-scoped app access instead of a user token.
body string
Comment body
Markdown body to post as the issue comment. This value is rendered before the request is sent
commentId integerstring
Comment ID
Identifier of an existing comment to update in place. When set, the task updates that comment instead of creating a new one and fails if no comment with this id exists on the issue. Takes precedence over updateTag.
endpoint string
GitHub API endpoint
GitHub or GitHub Enterprise API base URL such as https://api.github.com or https://ghe.acme.com/api/v3. Set this when targeting GitHub Enterprise or a non-default API endpoint.
jwtToken string
GitHub JWT token
GitHub App JWT used for app-level authentication. Use this when the task should authenticate as the app rather than a user.
login string
GitHub login
GitHub login used with oauthToken for authenticated requests. Leave unset when authenticating with jwtToken or appInstallationToken.
oauthToken string
GitHub OAuth token
GitHub personal access token used for authenticated requests. Can be used alone or with login.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
repository string
Target repository
Repository in owner/repo format containing the issue
updateTag string
Update tag
A stable identifier used to keep a single, continuously-updated comment. It is embedded in the comment body as a hidden HTML marker. When set, the task looks for an existing comment on the issue carrying the same tag and updates it in place; if none is found, a new tagged comment is created. Ideal for recurring reports (e.g. a test report) where you want one comment that gets refreshed instead of a new comment on every run. Ignored when commentId is set.
Outputs
commentId integer
Comment ID
Identifier of the created or updated comment. Feed this back into commentId to update the same comment later.
commentUrl
Comment URL
GitHub URL for the created or updated comment
java.net.URL
issueUrl
Issue URL
GitHub URL for the issue that received the comment
java.net.URL
updated boolean
Updated
true when an existing comment was updated in place, false when a new comment was created.