{"id":19880460,"url":"https://github.com/wesleyscholl/create-discussion-comment","last_synced_at":"2025-05-02T13:32:14.018Z","repository":{"id":193061991,"uuid":"688029418","full_name":"wesleyscholl/create-discussion-comment","owner":"wesleyscholl","description":"A GitHub Action for Creating Discussion Comments ⌨️💬✅","archived":false,"fork":false,"pushed_at":"2023-11-15T21:01:27.000Z","size":4417,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T01:03:24.783Z","etag":null,"topics":["comment","comment-system","commenting","comments","discuss","discussion","discussion-board","discussion-forum","discussion-platform","discussions","github-actions"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/create-discussion-comment","language":null,"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/wesleyscholl.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}},"created_at":"2023-09-06T13:58:12.000Z","updated_at":"2025-02-27T16:34:36.000Z","dependencies_parsed_at":"2023-11-15T15:27:36.238Z","dependency_job_id":"c944dae4-d9ee-4af6-83a6-67b1b370d57a","html_url":"https://github.com/wesleyscholl/create-discussion-comment","commit_stats":null,"previous_names":["wesleyscholl/create-discussion-comment"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesleyscholl%2Fcreate-discussion-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesleyscholl%2Fcreate-discussion-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesleyscholl%2Fcreate-discussion-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesleyscholl%2Fcreate-discussion-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wesleyscholl","download_url":"https://codeload.github.com/wesleyscholl/create-discussion-comment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252046253,"owners_count":21685980,"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","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":["comment","comment-system","commenting","comments","discuss","discussion","discussion-board","discussion-forum","discussion-platform","discussions","github-actions"],"created_at":"2024-11-12T17:11:28.001Z","updated_at":"2025-05-02T13:32:13.762Z","avatar_url":"https://github.com/wesleyscholl.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Create Discussion Comment ⌨️💬✅\n\n#### Create Comments on Exsiting GitHub Discussions using GitHub Actions\n\n [![Tests](https://img.shields.io/badge/Tests-Pass-gree.svg?logo=github\u0026colorA=24292e)](https://github.com/wesleyscholl/create-discussion-comment) \n \n [![Code Style: prettier](https://img.shields.io/badge/Code_Style-Prettier-ff69b4.svg?logo=prettier\u0026colorA=24292e\u0026logoColor=white)](https://github.com/prettier/prettier) \n \n [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Create%20Discussion%20Comment-blue.svg?colorA=24292e\u0026colorB=0366d6\u0026style=flat\u0026longCache=true\u0026logo=github)](https://github.com/marketplace/actions/)\n\n\n\n\n## About\n\nThis action allows you to add comments to GitHub Discussions using GitHub Actions.\n\n## Usage\n\nIn your workflow, to create a new comment on a discussion topic, include a step like this:\n\n\n```yaml\n    - name: Run create-discussion-comment\n      uses: wesleyscholl/create-discussion-comment@v1.0.x\n      id: create-comment\n      with:\n        token: ${{ secrets.DISCUSS_TOKEN }}\n        body: \"This is a test comment from a GitHub action\"          \n        discussion-id: 'D_kwdje64ife75s9o'\n        client-mutation-id: '1234'\n```\n*Ensure you provide the discussion ID, this can be found using the GitHub GraphQL Explorer. (See below)*\n\n\n## Action Inputs\n\n| Name | Description | Requried? | Default |\n| --- | --- | --- | --- |\n| `token` | A GitHub PAT is required. Ensure the PAT has `discussion: write` and `public_repo: read` for public repos and `repo: write` for private repositories. See more details about tokens here [PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). | **Yes** | N/A | \n| `body` | The contents of the comment in string format. | **No** | \"Comment provided by GitHub Action create-discussion-comment\" |\n| `discussion-id` | The node ID of the discussion to comment on. This can be found using the GitHub GraphQL explorer, more details below. | **Yes** | N/A |\n| `client-mutation-id` | A unique identifier for the client performing the mutation. | **No** | \"1234\" |\n|`replyToId` | The node ID of the discussion comment to reply to. If absent, the created comment will be a top-level comment. | **No** | N/A |\n\n\n## Action Outputs\n\n| Name | Description | Data Model |\n| --- | --- | --- |\n| `clientMutationId` | The unique identifier provided as an input. | See below |\n| `comment` | The discussion comment that was created. | See below |\n\n### Response\n\n```json\n{\"data\":\n{\"addDiscussionComment\":\n{\"clientMutationId\":\"1234\",\n\"comment\":{\n    \"id\":\"DC_kwdje64ife75s9o\",\n    \"body\":\"This is a test comment from a GitHub action\"\n    }}}}\n```\n\n## Obtaining the `discussion-id`\n\nYou can find your `discussion-id` and using [GitHub's GraphQL Explorer](https://docs.github.com/en/graphql/overview/explorer). Replace `\u003cREPO_NAME\u003e` and `\u003cREPO_OWNER\u003e` to find the discussion id you wish to comment on.\n### GraphQL Query\n```graphql\nquery {\n  repository(owner: \"\u003cREPO_OWNER\u003e`\", name: \"cohere\") {\n    discussions(first: 5) {\n      edges {\n        node {\n          # The value below is the discussion-id\n          id\n          title\n          category {\n            id\n            name\n          }\n          body\n          id\n        }\n      }\n    }\n  }\n}\n```\n\n### GraphQL Output\n\n```json\n{\n  \"data\": {\n    \"repository\": {\n      \"discussions\": {\n        \"edges\": [\n          {\n            \"node\": {\n              // This is the discussion-id  \n              \"id\": \"D_kwdje64ife75s9o\",\n              \"title\": \"Test Topic Title - Insert Question Here\",\n              \"category\": {\n                \"id\": \"DIC_kwSWEbhiT23EW-rr\",\n                \"name\": \"Q\u0026A\"\n              },\n              \"body\": \"This is the body of the discussion topic\"\n            }\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\n## Example\n\nExample [workflow](https://github.com/wesleyscholl/create-discussion-comment/blob/main/.github/workflows/create-comment.yml) can be found here.\n\n## Credits\n\n### Inspired by:\n- [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment)\n- [abirismyname/create-discussion](https://github.com/abirismyname/create-discussion)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesleyscholl%2Fcreate-discussion-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwesleyscholl%2Fcreate-discussion-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesleyscholl%2Fcreate-discussion-comment/lists"}