{"id":18452895,"url":"https://github.com/miry/prcomment","last_synced_at":"2025-08-10T03:07:50.660Z","repository":{"id":136894858,"uuid":"200517983","full_name":"miry/prcomment","owner":"miry","description":"Update or create a new comment to PR or Issue.","archived":false,"fork":false,"pushed_at":"2024-03-10T21:50:05.000Z","size":42,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T12:19:12.414Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-04T16:46:10.000Z","updated_at":"2024-03-11T02:59:14.000Z","dependencies_parsed_at":"2024-11-06T07:47:36.079Z","dependency_job_id":null,"html_url":"https://github.com/miry/prcomment","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/miry/prcomment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miry%2Fprcomment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miry%2Fprcomment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miry%2Fprcomment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miry%2Fprcomment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miry","download_url":"https://codeload.github.com/miry/prcomment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miry%2Fprcomment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269668900,"owners_count":24456560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T07:34:48.556Z","updated_at":"2025-08-10T03:07:50.618Z","avatar_url":"https://github.com/miry.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua/)\n\n# PRCOMMENT\n\n[![](https://img.shields.io/github/release/miry/prcomment.svg?style=flat)](https://github.com/miry/prcomment/releases)\n[![](https://img.shields.io/github/license/miry/prcomment)](https://raw.githubusercontent.com/miry/prcomment/master/LICENSE)\n[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)\n[![Made in Ukraine](https://img.shields.io/badge/made_in-ukraine-ffd700.svg?labelColor=0057b7)](https://stand-with-ukraine.pp.ua)\n\nCreates or updates single comment to Github PR or Issue.\n\n# Usage\n\nFirst step is generate a new Github token in [Github Settings](https://github.com/settings/tokens/new?description=prcomment\u0026scopes=public_repo).\n\n## Binaries\n\n```shell\nexport GITHUB_TOKEN=\u003cpersonal token\u003e\nprcomment -i 1 -r miry/prcomment Hello from console\n```\n\n## Docker\n\n```shell\ndocker run -e GITHUB_TOKEN=\u003ctoken\u003e --rm -it ghcr.io/miry/prcomment:0.1.3 -i 1 -r miry/prcomment Hello\n```\n\n## Crystal\n\n```shell\nexport GITHUB_TOKEN=\u003cpersonal token\u003e\ncrystal run src/cli.cr -- -i 1 -r miry/prcomment Hello\n```\n\n## GithubAction\n\n### Inputs\n\n### msg\n\n**Required** The msg of the comment. Default `\"World\"`.\n\n### pr\n\n**Optional** The PR or Issue ID where to add a comment. Default `github.event.pull_request.number`.\n\n### match\n\n**Optional** Pattern of the comment to be replaced with. Default `\"\"`\n\n\n### Examples\n\n```yml\nsteps:\n  -\n    uses: miry/prcomment@v0.1.3\n    if: github.event_name == 'pull_request'\n    name: Comment\n    with:\n      msg: \"Testing simple message from job ${{ github.run_id }}!\"\n      match: 'Testing simple message from job .*'\n      pr: ${{ github.event.pull_request.number }}\n      token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n# Options\n\n## Match\n\nOne of the cases to have comment to show current test coverage.\nBy default, `prcomment` looks for first comment with same text.\n\n```shell\ncrystal run src/cli.cr -- -i 1 -r miry/prcomment -m \"Test coverage \\d*%\" Test coverage 80%  # Creates a comment with text: 'Test coverage 80%'\ncrystal 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%'\n```\n\nIt is also usefull to change previous answer with new one:\n\n```shell\ncrystal run src/cli.cr -- -i 1 -r miry/prcomment -m \":[+-]1:\" \":+1:\"  # Creates a comment with icon: ':+1'\ncrystal run src/cli.cr -- -i 1 -r miry/prcomment -m \":[+-]1:\" \":-1:\"  # Replaces with ':-1:'\n```\n\nThe comment is too big for single line:\n\n```shell\necho \"The big content could be piped\\nSome pattern from the comment\\nThird line\" | \\\n  crystal run src/cli.cr -- -i 1 -r miry/prcomment -m \"Some pattern from the comment\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiry%2Fprcomment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiry%2Fprcomment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiry%2Fprcomment/lists"}