Update Comment

A lightweight GitHub Action to create or update PR comments (and linked issues) using the first line as an identifier

Why Update Comment?

Simple, efficient PR comment management for your workflows

🎯

Simple Identifier

Uses the first line of your comment as a unique identifier. No need to track comment IDs manually.

Lightweight

Pure composite action using gh CLI. No JavaScript runtime or external dependencies required.

🔄

Smart Updates

Automatically creates new comments or updates existing ones. Syncs to linked issues too!

Quick Start

Add it to your workflow in seconds

.github/workflows/deploy.yml
- name: Update PR Comment
  uses: starburst997/update-comment@v1
  with:
    body: |
      ## Deployment Status 🚀

      | Latest commit | ${{ github.sha }}           |
      |:--------------|:----------------------------|
      | **Status**    | ✅ Deployed                 |
      | **URL**       | https://preview.example.com |

API Reference

Complete list of inputs and outputs

Core Inputs

Input Description Default
token GitHub token for authentication optional ${{ github.token }}
issue-number Pull request or issue number optional ${{ github.event.pull_request.number }}
body Comment body (first line used as identifier) required -
update-linked-issue Update linked issue comments automatically optional true

Template Selection (optional, boolean)

Input Description
template-pr-deploy Use PR deploy template
template-pr-cleanup Use PR cleanup template

Template Parameters (optional)

Input Description
template-repository-name Repository name for template
template-sha Commit SHA for template
template-status Status: 'success', 'progress', or 'fail'
template-version Version for template
template-future-version Future version for template
template-environment Environment for template
template-url URL for template
template-pattern Pattern for cleanup template
template-versions-markdown Versions markdown for cleanup template
template-logs-url Logs URL for template

Outputs

Output Description
comment-id The ID of the created or updated comment
comment-url The URL of the created or updated comment
comment-body The body of the created or updated comment