Skip to content

3MUl0R/bashful-comment

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bashful Comment

A lightweight GitHub Action to add, update, or manage pull request comments.

No Node.js required — uses only bash, jq, perl, and gh (all pre-installed on GitHub runners). No node_modules, no build step, immune to Node.js version deprecations.

Marker-compatible with mshick/add-pr-comment — uses the same <!-- add-pr-comment:... --> comment markers so existing sticky comments are found and updated seamlessly. See Differences for feature gaps.

Usage

Basic

- uses: 3MUl0R/bashful-comment@v1
  with:
    message: |
      Deployment succeeded!
      Version: ${{ env.VERSION }}

Status-aware messages

- uses: 3MUl0R/bashful-comment@v1
  if: success() || failure()
  with:
    message-success: "Deploy succeeded"
    message-failure: "Deploy failed"

Update instead of duplicate

- uses: 3MUl0R/bashful-comment@v1
  with:
    message-id: "deploy-status"
    message: "Latest deploy: ${{ env.VERSION }}"

Read message from file

- uses: 3MUl0R/bashful-comment@v1
  with:
    message-path: coverage-report.txt
    preformatted: true

Glob file paths

- uses: 3MUl0R/bashful-comment@v1
  with:
    message-path: |
      reports/*.txt
      summary.md

Find and replace in existing comment

- uses: 3MUl0R/bashful-comment@v1
  with:
    message-id: "status-tracker"
    find: |
      Status: .*/gi
    replace: |
      Status: Complete

GitHub Enterprise Server

- uses: 3MUl0R/bashful-comment@v1
  with:
    message: "Deployed!"
    github-host: github.example.com
    github-enterprise-token: ${{ secrets.GHE_TOKEN }}

Inputs

Input Default Description
message Comment body (mutually exclusive with message-path)
message-path Path(s) or glob(s) to file(s) to use as message (newline-separated, mutually exclusive with message)
message-id Unique ID for finding/updating existing comments
refresh-message-position false Delete + recreate to move updated comment to bottom
repo-token ${{ github.token }} GitHub token
repo-owner ${{ github.repository_owner }} Repository owner
repo-name ${{ github.event.repository.name }} Repository name
allow-repeats false Allow duplicate comments
status ${{ job.status }} Job status for status-specific messages
message-success Message when status is success
message-failure Message when status is failure
message-cancelled Message when status is cancelled
message-skipped Message when status is skipped
issue Explicit issue/PR number
update-only false Only update existing comments, don't create new
preformatted false Wrap message in a code block
find Regex pattern(s) to find in existing comment (one per line, supports inline modifiers like /pattern/gi)
replace Replacement(s) for find patterns (one per line; single replacement reused for all patterns)
github-host GitHub Enterprise Server hostname
github-enterprise-token Token for GHES

Outputs

Output Description
comment-created true if a new comment was created
comment-updated true if an existing comment was updated (includes refresh mode)
comment-id ID of the created or updated comment

Runtime requirements

This action uses tools pre-installed on all GitHub-hosted runners:

  • bash — shell execution
  • gh — GitHub API calls (authenticated via repo-token)
  • jq — JSON parsing
  • perl — regex find/replace

Differences from mshick/add-pr-comment

  • No proxy-url support. The original supports a proxy service for commenting on fork-based PRs where GITHUB_TOKEN lacks write permissions. This action does not implement proxy support. For fork PRs, consider using a pull_request_target event trigger instead. Security note: pull_request_target runs with write access to the base repo — only use it if your workflow does not check out or execute code from the PR. See GitHub's security guidance.
  • No Node.js dependency. This means no vulnerability scanning noise from transitive npm packages and no Node.js version deprecation warnings.

License

MIT

About

Lightweight GitHub Action to add/update PR comments. Zero dependencies - pure shell + gh CLI.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages