{"id":19885767,"url":"https://github.com/konjoinfinity/mark-discussion-comment-answer","last_synced_at":"2025-09-18T21:31:08.912Z","repository":{"id":199110761,"uuid":"701296831","full_name":"konjoinfinity/mark-discussion-comment-answer","owner":"konjoinfinity","description":"Mark Discussion Comment Answer GitHub Action 🙋🏻‍♂️💬✅ Automatically mark discussion comment answers based on the highest number of positive reactions.","archived":false,"fork":false,"pushed_at":"2023-11-15T05:37:48.000Z","size":4299,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-12T17:49:00.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/konjoinfinity.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-10-06T10:49:43.000Z","updated_at":"2024-11-01T01:01:04.000Z","dependencies_parsed_at":"2023-10-16T12:57:58.796Z","dependency_job_id":"1092a401-7a5a-481e-b8e5-24058cbe94aa","html_url":"https://github.com/konjoinfinity/mark-discussion-comment-answer","commit_stats":null,"previous_names":["konjoinfinity/mark-discussion-comment-answer"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konjoinfinity%2Fmark-discussion-comment-answer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konjoinfinity%2Fmark-discussion-comment-answer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konjoinfinity%2Fmark-discussion-comment-answer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konjoinfinity%2Fmark-discussion-comment-answer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konjoinfinity","download_url":"https://codeload.github.com/konjoinfinity/mark-discussion-comment-answer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233524167,"owners_count":18689078,"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":[],"created_at":"2024-11-12T17:35:29.486Z","updated_at":"2025-09-18T21:31:03.346Z","avatar_url":"https://github.com/konjoinfinity.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mark Discussion Comment Answer 🙋🏻‍♂️💬✅\n\nThis GitHub Action marks a discussion comment as the answer\n\n[![Tests](https://img.shields.io/badge/tests-passing-gree.svg?logo=typescript\u0026colorA=24292e\u0026logoColor=white)](https://github.com/konjoinfinity/mark-discussion-comment-answer/blob/main/src/__tests__/index.test.ts)  ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/konjoinfinity/mark-discussion-comment-answer/.github%2Fworkflows%2Fnode.js.yml?colorA=24292e\u0026logo=github) ![GitHub Release Date - Published_At](https://img.shields.io/github/release-date/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026logo=github) [![coverage badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/wesleyscholl/fce8ce592425f8cc73ea124451808ce3/raw/450280b16d4e7a800f402f2233b224a2a37c7086/github-action-base-ts__heads_main.json?\u0026colorA=24292e\u0026label=test%20coverage)](https://gist.github.com/wesleyscholl/10f0b77400703c4a65f38434106adf2d)  [![GitHub Marketplace](https://img.shields.io/badge/marketplace-Mark%20Discussion%20Comment%20Answer-blue.svg?colorA=24292e\u0026colorB=7F00FF\u0026style=flat\u0026longCache=true\u0026logo=githubactions\u0026logoColor=white)](https://github.com/marketplace/actions/mark-discussion-comment-answer) ![GitHub package.json dynamic](https://img.shields.io/github/package-json/name/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026colorB=7F00FF\u0026logo=github) ![Dynamic YAML Badge](https://img.shields.io/badge/dynamic/yaml?url=https://raw.githubusercontent.com/konjoinfinity/mark-discussion-comment-answer/main/action.yml\u0026query=%24.description\u0026colorA=24292e\u0026colorB=7F00FF\u0026logo=yaml\u0026label=description) [![Code Style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?logo=prettier\u0026colorA=24292e\u0026logoColor=white\u0026colorB=7F00FF)](https://github.com/prettier/prettier) [![Code Linter: ESLint](https://img.shields.io/badge/code_linter-eslint-ff69b4.svg?logo=eslint\u0026colorA=24292e\u0026logoColor=white\u0026colorB=7F00FF)](https://github.com/prettier/prettier) ![GitHub top language](https://img.shields.io/github/languages/top/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026colorB=7F00FF\u0026logo=typescript\u0026logoColor=white) ![GitHub contributors](https://img.shields.io/github/contributors/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026colorB=7F00FF\u0026logo=github\u0026logoColor=white)  ![GitHub Discussions](https://img.shields.io/github/discussions/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026colorB=7F00FF\u0026logo=github\u0026logoColor=white) ![GitHub Release (with filter)](https://img.shields.io/github/v/release/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026colorB=7F00FF\u0026logo=github)  ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026colorB=7F00FF\u0026logo=github) ![GitHub repo size](https://img.shields.io/github/repo-size/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026colorB=7F00FF\u0026logo=github) ![GitHub package.json dynamic](https://img.shields.io/github/package-json/author/konjoinfinity/mark-discussion-comment-answer?colorA=24292e\u0026colorB=7F00FF\u0026logo=github) [![MIT](https://img.shields.io/badge/license-MIT-blue?colorA=24292e\u0026colorB=7F00FF\u0026logo=github)](https://raw.githubusercontent.com/konjoinfinity/mark-discussion-comment-answer/main/LICENSE)\n\n\n\n\n## About\n\nThis GitHub action automatically marks discussion comments with the highest number of reactions as the answer.\n\n\n## Usage\n\nIn your workflow, to use this github action add a step like this to your workflow:\n\n\n```yaml\n      - name: Run Mark Discussion Comment Answer\n        id: markanswer\n        uses: konjoinfinity/mark-discussion-comment-answer@v1.0.x\n        with:\n          GH_TOKEN: \"${{ secrets.DISCUSS_TOKEN }}\" # PAT required for private repos\n          reaction_threshold: 3 # Number of reactions required to mark a comment as the answer   \n          \n```     \n\n##### Example Output\n```bash\nDC_kwDOKczwv84AbnqH\n{\n  markDiscussionCommentAsAnswer: {\n    clientMutationId: '1234',\n    discussion: { id: 'D_kwDOKczwv84AV0aF' }\n  }\n}\ndiscussionId = {id:D_kwDOKczwv84AV0aF}\n```\n\n## Requirements\n\nNo extra configuration required to run this GitHub Action. \n\n\n\n\n\n\n## Inputs\n\n| Name | Type | Description | Requried? | Default |\n| --- | --- | --- | --- | --- |\n| `GH_TOKEN` | String | A GitHub PAT is required, but the default is sufficient for public repos. For private repos, ensure you create a PAT that has discussion: write and repo: write, then store it as an action secret for usage within the workflow. See more details about tokens here - [PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).  | **No** | `\"${{ secrets.GITHUB_TOKEN }}\"` | \n| `reaction_threshold` | Number  | Number of positive comment reactions required to mark as an answer. (Ex. `3`, `10`) Positive emoji reactions are: `[\"+1\", \"LAUGH\", \"HEART\", \"HOORAY\", \"ROCKET\"]` | **No** | `0` |\n\n\n\n\n## Outputs\n\n| Name | Description | How To Access |\n| --- | --- | --- |\n| `discussionId` | Discussion ID where the marked as answered comment resides. | `${{ steps.\u003cyour-step\u003e.outputs.discussionId }}` |\n| `clientMutationId` | GraphQL Mutation ID for the client. | `${{ steps.\u003cyour-step\u003e.outputs.clientMutationId }}` |\n| `commentText` | Body of the comment with the highest number of positive reactions/emojis. | `${{ steps.\u003cyour-step\u003e.outputs.commentText }}` |\n| `reactionThreshold` | Number of positive reactions/emojis required to mark a comment as the answer. | `${{ steps.\u003cyour-step\u003e.outputs.reactionThreshold }}` |\n| `totalReactions` | Total number of reactions for the comment with the highest number of positive reactions/emojis. | `${{ steps.\u003cyour-step\u003e.outputs.totalReactions }}` |\n| `commentId` | Comment ID for the comment with the highest number of positive reactions/emojis. | `${{ steps.\u003cyour-step\u003e.outputs.commentId }}` |\n\n\n\n\n\n#### Accessing Outputs \n```yml\n- name: Show Output\n  run: |\n    echo ${{ steps.\u003cyour-step\u003e.outputs.discussionId }}\n    echo ${{ steps.\u003cyour-step\u003e.outputs.clientMutationId }}\n    echo ${{ steps.\u003cyour-step\u003e.outputs.commentText }}\n    echo ${{ steps.\u003cyour-step\u003e.outputs.reactionThreshold }}\n    echo ${{ steps.\u003cyour-step\u003e.outputs.totalReactions }}\n    echo ${{ steps.\u003cyour-step\u003e.outputs.commentId }}\n```\n\n\n\n\n## Example\n\nLink to [workflow](https://raw.githubusercontent.com/wesleyscholl/auto/main/.github/workflows/new.yaml)\n\n```yaml\nname: Mark Discussion Comment Answer\n\non:\n  discussion_comment:\n    types: [created]\n\njobs:\n  mark-comment-answer:\n    name: Mark a discussion comment as the answer\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v3\n        \n      - name: Run Mark Discussion Comment Answer\n        id: markanswer\n        uses: konjoinfinity/mark-discussion-comment-answer@v1.0.x\n        with:\n          GH_TOKEN: \"${{ secrets.DISCUSS_TOKEN }}\" # PAT required for private repos\n          reaction_threshold: 3 # Number of reactions required to mark a comment as the answer\n          \n      - name: Show Mark Answer Output\n        run: |\n          echo \"discussionId = ${{ steps.markanswer.outputs.discussionId }}\"\n          echo \"clientMutationId = ${{ steps.markanswer.outputs.clientMutationId }}\"\n          echo \"commentText = ${{ steps.markanswer.outputs.commentText }}\"\n          echo \"reactionThreshold = ${{ steps.markanswer.outputs.reactionThreshold }}\"\n          echo \"totalReactions = ${{ steps.markanswer.outputs.totalReactions }}\"\n          echo \"commentId = ${{ steps.markanswer.outputs.commentId }}\"\n```\n\n##### Example Output\n```js\n{\n  markDiscussionCommentAsAnswer: {\n    clientMutationId: '1234',\n    discussion: { id: 'D_kwDOKczwv84AV0aF' }\n  }\n}\n```\n\n## Credits\n\n- [Using the GraphQL API for Discussions](https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions)\n- [GitHub GraphQL Explorer](https://docs.github.com/en/graphql/overview/explorer)\n\n#### Inspired by:\n- [Create and Publish a GitHub Action in Typescript - Leonardo Montini](https://leonardomontini.dev/typescript-github-action/)\n- [Discussion Autoresponder - GitHub Action](https://github.com/marketplace/actions/discussion-auto-responder)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonjoinfinity%2Fmark-discussion-comment-answer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonjoinfinity%2Fmark-discussion-comment-answer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonjoinfinity%2Fmark-discussion-comment-answer/lists"}