prcomment
Version, currently 0.1.34 versions
- 0.1.3latestMar 10, 2024
- 0.1.2not indexedMar 10, 2024
- 0.1.1not indexedMar 10, 2024
- 0.1.0not indexedMar 10, 2024
github.com/miry/prcomment
Creates or updates a comment for Github Pull Request or Github Issue.
Installation
# Add this to your shard.yml
dependencies:
prcomment:
github: miry/prcomment
version: ~> 0.1.3Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- LGPL-3.0
- Author
- Michael Nikitochkin
- Target
prcommentfrom src/cli.cr
Dependencies
This version declares no dependencies.
README
PRCOMMENT
Creates or updates single comment to Github PR or Issue.
Usage
First step is generate a new Github token in Github Settings.
Binaries
export GITHUB_TOKEN=<personal token>
prcomment -i 1 -r miry/prcomment Hello from console
Docker
docker run -e GITHUB_TOKEN=<token> --rm -it miry/prcomment:0.1.3 -i 1 -r miry/prcomment Hello
Crystal
export GITHUB_TOKEN=<personal token>
crystal run src/cli.cr -- -i 1 -r miry/prcomment Hello
GithubAction
Inputs
msg
Required The msg of the comment. Default "World".
pr
Optional The PR or Issue ID where to add a comment. Default github.event.pull_request.number.
match
Optional Pattern of the comment to be replaced with. Default ""
Examples
steps:
-
uses: miry/prcomment@v0.1.3
if: github.event_name == 'pull_request'
name: Comment
with:
msg: "Testing simple message from job ${{ github.run_id }}!"
match: 'Testing simple message from job .*'
pr: ${{ github.event.pull_request.number }}
token: ${{ secrets.GITHUB_TOKEN }}
Options
Match
One of the cases to have comment to show current test coverage.
By default, prcomment looks for first comment with same text.
crystal run src/cli.cr -- -i 1 -r miry/prcomment -m "Test coverage \d*%" Test coverage 80% # Creates a comment with text: 'Test coverage 80%'
crystal run src/cli.cr -- -i 1 -r miry/prcomment -m "Test coverage \d*%" Test coverage 130% # Finds the comment and replaces with: 'Test coverage 130%'
It is also usefull to change previous answer with new one:
crystal run src/cli.cr -- -i 1 -r miry/prcomment -m ":[+-]1:" ":+1:" # Creates a comment with icon: ':+1'
crystal run src/cli.cr -- -i 1 -r miry/prcomment -m ":[+-]1:" ":-1:" # Replaces with ':-1:'
The comment is too big for single line:
echo "The big content could be piped\nSome pattern from the comment\nThird line" | \
crystal run src/cli.cr -- -i 1 -r miry/prcomment -m "Some pattern from the comment"
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.3- Tagged
- Mar 10, 2024
- Commit
f4a1b74cdc24- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/miry/prcomment
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 4