{"id":15825649,"url":"https://github.com/htunnicliff/replace-comment-html","last_synced_at":"2026-04-27T21:31:11.790Z","repository":{"id":222204480,"uuid":"756579244","full_name":"htunnicliff/replace-comment-html","owner":"htunnicliff","description":"An action to upsert HTML in GitHub issue or pull request comments using CSS selectors","archived":false,"fork":false,"pushed_at":"2026-02-13T21:11:27.000Z","size":280,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-13T23:14:11.428Z","etag":null,"topics":["actions","comments","html"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/htunnicliff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"buy_me_a_coffee":"htunnicliff"}},"created_at":"2024-02-12T22:05:08.000Z","updated_at":"2026-01-22T02:54:42.000Z","dependencies_parsed_at":"2024-02-12T23:26:04.980Z","dependency_job_id":"798b36a1-a29e-41c4-905a-7113039cfec3","html_url":"https://github.com/htunnicliff/replace-comment-html","commit_stats":null,"previous_names":["htunnicliff/replace-comment-html"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/htunnicliff/replace-comment-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htunnicliff%2Freplace-comment-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htunnicliff%2Freplace-comment-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htunnicliff%2Freplace-comment-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htunnicliff%2Freplace-comment-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/htunnicliff","download_url":"https://codeload.github.com/htunnicliff/replace-comment-html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/htunnicliff%2Freplace-comment-html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["actions","comments","html"],"created_at":"2024-10-05T09:21:53.888Z","updated_at":"2026-04-27T21:31:11.774Z","avatar_url":"https://github.com/htunnicliff.png","language":"TypeScript","funding_links":["https://buymeacoffee.com/htunnicliff"],"categories":[],"sub_categories":[],"readme":"# Replace Comment HTML\n\nThis action upserts HTML in GitHub issue or pull request comments using CSS selectors.\n\n## Usage\n\nHere's an example of how you might use this action in a workflow:\n\n```yaml\nname: Deploy Previews\n\non:\n  pull_request:\n    branches:\n      - main\n\njobs:\n  deploy:\n    strategy:\n      matrix:\n        env: [dev, stage, prod]\n    steps:\n      # ... steps to deploy preview envionment ...\n\n      # Create a comment with an empty table\n      - uses: htunnicliff/replace-comment-html@v1\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          selector: \"#preview-links\"\n          mode: create-only # This will create the table if it doesn't exist\n          html: |\n            \u003ctable id=\"preview-links\"\u003e\n              \u003cthead\u003e\n                \u003ctr\u003e\n                  \u003cth\u003eEnvironment\u003c/th\u003e\n                  \u003cth\u003ePreview Link\u003c/th\u003e\n                \u003c/tr\u003e\n              \u003c/thead\u003e\n              \u003ctbody\u003e\n              \u003c/tbody\u003e\n            \u003c/table\u003e\n\n      # Add a row for the deployed environment\n      - uses: htunnicliff/replace-comment-html@v1\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          parent-selector: \"#preview-links tbody\" # Append this row to the \u003ctbody\u003e\n          selector: \"tr#preview-link-${{ matrix.env }}\"\n          mode: upsert # This will update the row if it exists, or create it if it doesn't\n          html: |\n            \u003ctr id=\"preview-link-${{ matrix.env }}\"\u003e\n              \u003ctd\u003e${{ matrix.env }}\u003c/td\u003e\n              \u003ctd\u003e\n                \u003ca href=\"https://preview-${{ matrix.env }}.example.com\"\u003ePreview\u003c/a\u003e\n              \u003c/td\u003e\n            \u003c/tr\u003e\n\n      # ...\n```\n\nThe resulting comment will contain a table that looks like this:\n\n```html\n\u003ctable id=\"preview-links\"\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eEnvironment\u003c/th\u003e\n      \u003cth\u003ePreview Link\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr id=\"preview-link-dev\"\u003e\n      \u003ctd\u003edev\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ca href=\"https://preview-dev.example.com\"\u003ePreview\u003c/a\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr id=\"preview-link-stage\"\u003e\n      \u003ctd\u003estage\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ca href=\"https://preview-stage.example.com\"\u003ePreview\u003c/a\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr id=\"preview-link-prod\"\u003e\n      \u003ctd\u003eprod\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ca href=\"https://preview-prod.example.com\"\u003ePreview\u003c/a\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n```\n\nIf this workflow runs again and a row exists with the given CSS selector, it will be replaced with a new version while other HTML remains unmodified.\n\n## Inputs\n\n| Name              | Description                                                                   | Default                    |\n| ----------------- | ----------------------------------------------------------------------------- | -------------------------- |\n| `html`            | HTML to create or update                                                      |                            |\n| `selector`        | A CSS selector for identifying the element to update                          |                            |\n| `parent-selector` | A CSS selector for identfying a parent to append the element to               | `null`                     |\n| `token`           | `GITHUB_TOKEN` or a repo scoped [personal access token][PAT].                 | `${{ github.token }}`      |\n| `repository`      | The repository to update the comment in.                                      | `${{ github.repository }}` |\n| `issue-number`    | The issue or pull request number to update the comment in.                    | Current PR or issue number |\n| `mode`            | The strategy to use for modifying comments (either `upsert` or `create-only`) | `upsert`                   |\n\n## Outputs\n\n| Name         | Description                                       |\n| ------------ | ------------------------------------------------- |\n| `comment-id` | The ID of the comment that was created or updated |\n\n[PAT]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtunnicliff%2Freplace-comment-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhtunnicliff%2Freplace-comment-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhtunnicliff%2Freplace-comment-html/lists"}