Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
edit-3

GitHub Action

github-comment-pr

v1

github-comment-pr

edit-3

github-comment-pr

Comment on PR with custom text message

Installation

Copy and paste the following snippet into your .yml file.

              

- name: github-comment-pr

uses: meysam81/comment-pr@v1

Learn more about this action in meysam81/comment-pr

Choose a version

Comment PR

Tired of complex PR comment actions?

Comment PR provides a straightforward solution for adding and updating comments on Pull Requests.

Features

  • Unique Identifiers: Automatically prevents duplicate comments
  • 🔄 Smart Updates: Removes old comments and adds new ones to trigger notifications
  • 📝 Markdown Support: Full markdown capabilities for both title and content
  • 🎯 Minimal Configuration: Simple YAML setup with just three required fields

Why Choose Comment PR?

  • Simplicity First: Designed for developers who want a no-nonsense solution
  • Consistent Behavior: Predictable outcomes across all your workflows
  • Notification Friendly: Updates trigger GitHub notifications to keep your team informed

Perfect for CI/CD pipelines, automated reviews, and status updates on your Pull Requests.

Yet Another GH Action?

There are other GitHub Actions doing the same thing, yet their usage seemed so complicated to me and I wanted something simple and consistent.

The objective of this GitHub Action is as follows:

  • Have a unique identifier for the comment to avoid duplicates.
  • On subsequent runs, remove the old comment and add another of the exact same one just to get notified by email from the GitHub notification system.

Usage

jobs:
  comment-pr:
    permissions:
      pull-requests: write # this is necessary
    runs-on: ubuntu-latest
    steps:
      - name: Comment PR
        uses: meysam81/comment-pr@v1
        with:
          # `title` and `content` support markdown
          title: "# Custom title" # ensures idempotency through a unique identifier
          content: |
            My content goes here
          token: ${{ secrets.GITHUB_TOKEN }} # this is required