{"id":13596180,"url":"https://github.com/peaceiris/actions-label-commenter","last_synced_at":"2025-04-04T11:16:17.895Z","repository":{"id":37830947,"uuid":"245446611","full_name":"peaceiris/actions-label-commenter","owner":"peaceiris","description":"Label Commenter Action: Label triggered GitHub Action for posting a template comment, and automatically open/close/lock/unlock issues, pull-requests, and discussions.","archived":false,"fork":false,"pushed_at":"2025-03-18T05:55:12.000Z","size":6276,"stargazers_count":83,"open_issues_count":37,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T10:11:16.456Z","etag":null,"topics":["actions","github-actions","issue-management","project-management"],"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/peaceiris.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},"funding":{"github":"peaceiris","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-03-06T14:55:24.000Z","updated_at":"2025-03-18T05:54:43.000Z","dependencies_parsed_at":"2023-10-14T22:38:37.643Z","dependency_job_id":"b67ac83c-96cc-4948-ab04-0aa4e9dbaa8f","html_url":"https://github.com/peaceiris/actions-label-commenter","commit_stats":{"total_commits":1077,"total_committers":9,"mean_commits":"119.66666666666667","dds":0.5143918291550604,"last_synced_commit":"0ea8026e060f1ae52d4440a9aa44155588ef436c"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peaceiris%2Factions-label-commenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peaceiris%2Factions-label-commenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peaceiris%2Factions-label-commenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peaceiris%2Factions-label-commenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peaceiris","download_url":"https://codeload.github.com/peaceiris/actions-label-commenter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246938953,"owners_count":20857916,"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":["actions","github-actions","issue-management","project-management"],"created_at":"2024-08-01T16:02:11.160Z","updated_at":"2025-04-04T11:16:17.866Z","avatar_url":"https://github.com/peaceiris.png","language":"TypeScript","funding_links":["https://github.com/sponsors/peaceiris"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003e\nLabel Commenter Action\n\u003c/h2\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/30958501/125202658-75e49180-e2af-11eb-8825-153e34fb235f.jpg\" alt=\"Label Commenter Action thumbnail\" width=\"500px\"\u003e\n\n[![license](https://img.shields.io/github/license/peaceiris/actions-label-commenter.svg)](https://github.com/peaceiris/actions-label-commenter/blob/main/LICENSE)\n[![release](https://img.shields.io/github/release/peaceiris/actions-label-commenter.svg)](https://github.com/peaceiris/actions-label-commenter/releases/latest)\n[![GitHub release date](https://img.shields.io/github/release-date/peaceiris/actions-label-commenter.svg)](https://github.com/peaceiris/actions-label-commenter/releases)\n[![Release Feed](https://img.shields.io/badge/release-feed-yellow)](https://github.com/peaceiris/actions-label-commenter/releases.atom)\n\n[![Code Scanning](https://github.com/peaceiris/actions-label-commenter/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/peaceiris/actions-label-commenter/actions/workflows/codeql-analysis.yml)\n[![CodeFactor](https://www.codefactor.io/repository/github/peaceiris/actions-label-commenter/badge)](https://www.codefactor.io/repository/github/peaceiris/actions-label-commenter)\n[![codecov](https://codecov.io/gh/peaceiris/actions-label-commenter/branch/main/graph/badge.svg?token=WKTNMOY3SM)](https://codecov.io/gh/peaceiris/actions-label-commenter)\n\n\u003c/div\u003e\n\nThis action is one of label triggered GitHub Actions for posting a template comment, and automatically open/close/lock/unlock issues or pull-requests.\n\nThis Action was submitted to the [GitHub Actions Hackathon] and featured by GitHub. ([Featured actions from the GitHub Actions Hackathon - The GitHub Blog])\n\n[GitHub Actions Hackathon]: https://github.blog/2020-02-27-were-challenging-you-to-create-your-very-own-github-actions/\n[Featured actions from the GitHub Actions Hackathon - The GitHub Blog]: https://github.blog/2020-04-09-featured-actions-from-the-github-actions-hackathon/\n\n\n\n## Table of Contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Getting Started](#getting-started)\n  - [Workflow Setting](#workflow-setting)\n  - [Action Setting](#action-setting)\n- [Options](#options)\n  - [Set a Path to Action Setting File](#set-a-path-to-action-setting-file)\n  - [Set a Personal Access Token](#set-a-personal-access-token)\n  - [Enable Debug Mode](#enable-debug-mode)\n- [Work with Issue Template](#work-with-issue-template)\n- [Work with Other Auto Label Actions](#work-with-other-auto-label-actions)\n- [Examples](#examples)\n  - [Comment and Close Invalid Format Issue or Pull Request](#comment-and-close-invalid-format-issue-or-pull-request)\n  - [Reopen Issue or Pull Request](#reopen-issue-or-pull-request)\n  - [Comment and Close Wontfix Issue or Pull Request](#comment-and-close-wontfix-issue-or-pull-request)\n  - [Comment and Close Duplicate Issue or Pull Request](#comment-and-close-duplicate-issue-or-pull-request)\n  - [Comment Multiple Line](#comment-multiple-line)\n  - [Comment and Close Multiple Issues or Pull Requests](#comment-and-close-multiple-issues-or-pull-requests)\n  - [Lock or Unlock issue or Pull Request](#lock-or-unlock-issue-or-pull-request)\n- [Changelog](#changelog)\n- [License](#license)\n- [Maintainer](#maintainer)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n\n## Getting Started\n\nCreate your GitHub Actions workflow file and Label Commenter Action setting file. Commit those and push to the remote default branch.\n\n### Workflow Setting\n\nCreate your workflow file `.github/workflows/label-commenter.yml` as follows.\n\n```yaml\nname: Label Commenter\n\non:\n  issues:\n    types: [labeled, unlabeled]\n  pull_request_target:\n    types: [labeled, unlabeled]\n\npermissions:\n  contents: read\n  issues: write\n  pull-requests: write\n\njobs:\n  comment:\n    runs-on: ubuntu-20.04\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: Label Commenter\n        uses: peaceiris/actions-label-commenter@v1\n```\n\n### Action Setting\n\nCreate your action configuration file `.github/label-commenter-config.yml` as follows.\n\n```yaml\ncomment:\n  header: Hi, there.\n  footer: \"\\\n    ---\\n\\n\\\n    \u003e This is an automated comment created by the [peaceiris/actions-label-commenter]. \\\n    Responding to the bot or mentioning it won't have any effect.\\n\\n\\\n    [peaceiris/actions-label-commenter]: https://github.com/peaceiris/actions-label-commenter\"\n\nlabels:\n  - name: invalid\n    labeled:\n      issue:\n        body: Please follow the issue templates.\n        action: close\n      pr:\n        body: Thank you @{{ pull_request.user.login }} for suggesting this. Please follow the pull request templates.\n        action: close\n    unlabeled:\n      issue:\n        body: Thank you for following the template. The repository owner will reply.\n        action: open\n  - name: forum\n    labeled:\n      issue:\n        body: |\n          Please ask questions about GitHub Actions at the following forum.\n          https://github.community/c/github-actions\n        action: close\n  - name: wontfix\n    labeled:\n      issue:\n        body: This will not be worked on but we appreciate your contribution.\n        action: close\n    unlabeled:\n      issue:\n        body: This has become active again.\n        action: open\n  - name: duplicate\n    labeled:\n      issue:\n        body: This issue already exists.\n        action: close\n  - name: good first issue\n    labeled:\n      issue:\n        body: This issue is easy for contributing. Everyone can work on this.\n  - name: proposal\n    labeled:\n      issue:\n        body: Thank you @{{ issue.user.login }} for suggesting this.\n  - name: locked (spam)\n    labeled:\n      issue:\n        body: |\n          This issue has been **LOCKED** because of spam!\n\n          Please do not spam messages and/or issues on the issue tracker. You may get blocked from this repository for doing so.\n        action: close\n        locking: lock\n        lock_reason: spam\n      pr:\n        body: |\n          This pull-request has been **LOCKED** because of spam!\n\n          Please do not spam messages and/or pull-requests on this project. You may get blocked from this repository for doing so.\n        action: close\n        locking: lock\n        lock_reason: spam\n  - name: locked (heated)\n    labeled:\n      issue:\n        body: |\n          This issue has been **LOCKED** because of heated conversation!\n\n          We appreciate exciting conversations, as long as they won't become too aggressive and/or emotional.\n        locking: lock\n        lock_reason: too heated\n      pr:\n        body: |\n          This pull-request has been **LOCKED** because of heated conversation!\n\n          We appreciate exciting conversations, as long as they won't become too aggressive and/or emotional.\n        locking: lock\n        lock_reason: too heated\n    unlabeled:\n      issue:\n        body: |\n          This issue has been unlocked now.\n        locking: unlock\n      pr:\n        body: |\n          This pull-request has been unlocked now.\n        locking: unlock\n  - name: locked (off-topic)\n    labeled:\n      issue:\n        body: |\n          This issue has been **LOCKED** because of off-topic conversations!\n\n          Please use our other means of communication for casual chats.\n        action: close\n        locking: lock\n        lock_reason: off-topic\n  - name: locked (resolved)\n    labeled:\n      issue:\n        body: |\n          This issue has been **LOCKED** because of it being resolved!\n\n          The issue has been fixed and is therefore considered resolved.\n          If you still encounter this or it has changed, open a new issue instead of responding to solved ones.\n        action: close\n        locking: lock\n        lock_reason: resolved\n```\n\n\u003cdiv align=\"right\"\u003e\n\u003ca href=\"#table-of-contents\"\u003eBack to TOC ☝️\u003c/a\u003e\n\u003c/div\u003e\n\n\n\n## Options\n\n### Set a Path to Action Setting File\n\nDefault is `.github/label-commenter-config.yml`\n\n```yaml\n- name: Label Commenter\n  uses: peaceiris/actions-label-commenter@v1\n  with:\n    config_file: ./path_to/your_config.yml\n```\n\n### Set a Personal Access Token\n\nDefault is `${{ github.token }}`\n\n```yaml\n- name: Label Commenter\n  uses: peaceiris/actions-label-commenter@v1\n  with:\n    github_token: ${{ secrets.GH_PAT }}\n```\n\n### Enable Debug Mode\n\n```yaml\n- name: Label Commenter\n  uses: peaceiris/actions-label-commenter@v1\n  env:\n    RUNNER_DEBUG: 1\n```\n\n\u003cdiv align=\"right\"\u003e\n\u003ca href=\"#table-of-contents\"\u003eBack to TOC ☝️\u003c/a\u003e\n\u003c/div\u003e\n\n\n\n## Work with Issue Template\n\nHere is a proposal issue template: [.github/ISSUE_TEMPLATE/3_proposal.yml](https://github.com/peaceiris/actions-label-commenter/blob/main/.github/ISSUE_TEMPLATE/3_proposal.yml)\n\n```yaml\nname: Proposal\ndescription: Suggest an idea for this project\ntitle: ''\nlabels: proposal\nassignees: peaceiris\nbody:\n  ...\n```\n\nScenario:\n\n1. When a user opens an issue with the proposal template, the proposal label will be added automatically.\n1. This action can detect that `labeled` event and create a template comment of proposal.\n\n\u003cdiv align=\"right\"\u003e\n\u003ca href=\"#table-of-contents\"\u003eBack to TOC ☝️\u003c/a\u003e\n\u003c/div\u003e\n\n\n\n## Work with Other Auto Label Actions\n\n\u003e [Authenticating with the GITHUB_TOKEN - GitHub Docs](https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#using-the-github_token-in-a-workflow)\n\u003e\n\u003e When you use the repository's `GITHUB_TOKEN` to perform tasks, events triggered by the `GITHUB_TOKEN`, with the exception of `workflow_dispatch` and `repository_dispatch`, will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. For example, if a workflow run pushes code using the repository's `GITHUB_TOKEN`, a new workflow will not run even when the repository contains a workflow configured to run when `push` events occur.\n\nYou need to provide a personal access token (with [`public_repo`] for a public repository, [`repo`] for a private repository) to an auto label GitHub Actions or GitHub Bot like [actions/labeler](https://github.com/actions/labeler).\n\n[`public_repo`]: https://github.com/settings/tokens/new?description=actions-label-commenter\u0026scopes=public_repo\n[`repo`]: https://github.com/settings/tokens/new?description=actions-label-commenter\u0026scopes=repo\n\n```yaml\n# .github/workflows/labeler.yml\nname: \"Pull Request Labeler\"\n\non:\n  - pull_request_target\n\njobs:\n  triage:\n    runs-on: ubuntu-20.04\n    permissions: {}\n    timeout-minutes: 1\n    steps:\n      - uses: actions/labeler@v3\n        with:\n          repo-token: \"${{ secrets.GH_PAT }}\"\n```\n\nScenario:\n\n1. Someone updates the README.md and opens a pull-request.\n1. actions/labeler adds the documentation label automatically.\n1. peaceiris/actions-label-commenter creates the template comment automatically.\n\n\u003cdiv align=\"right\"\u003e\n\u003ca href=\"#table-of-contents\"\u003eBack to TOC ☝️\u003c/a\u003e\n\u003c/div\u003e\n\n\n\n## Examples\n\n### Comment and Close Invalid Format Issue or Pull Request\n\n[Source](https://github.com/peaceiris/actions-label-commenter/blob/v1.10.0/.github/label-commenter-config.yml#L11-L18)\n\n![Comment and Close Invalid Format Issue or Pull Request - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202643-711fdd80-e2af-11eb-9277-3f58be5fb0b7.jpg)\n\n### Reopen Issue or Pull Request\n\n[Source](https://github.com/peaceiris/actions-label-commenter/blob/v1.10.0/.github/label-commenter-config.yml#L19-L25)\n\n![Reopen Issue or Pull Request - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202646-73823780-e2af-11eb-9487-e7ab68d7e2dd.jpg)\n\n### Comment and Close Wontfix Issue or Pull Request\n\n[Source](https://github.com/peaceiris/actions-label-commenter/blob/v1.10.0/.github/label-commenter-config.yml#L33-L41)\n\n![Comment and Close Wontfix Issue or Pull Request - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202647-73823780-e2af-11eb-96ba-3977c08ea8a7.jpg)\n\n### Comment and Close Duplicate Issue or Pull Request\n\n[Source](https://github.com/peaceiris/actions-label-commenter/blob/v1.10.0/.github/label-commenter-config.yml#L42-L46)\n\n![Comment and Close Duplicate Issue or Pull Request - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202649-741ace00-e2af-11eb-9176-a35af80491b1.jpg)\n\n### Comment Multiple Line\n\n[Source](https://github.com/peaceiris/actions-label-commenter/blob/v1.10.0/.github/label-commenter-config.yml#L26-L32)\n\n![Comment Multiple Line - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202650-74b36480-e2af-11eb-9e21-e9014087eed2.jpg)\n\n### Comment and Close Multiple Issues or Pull Requests\n\n| Select Label | Labeled |\n|---|---|\n| ![Comment and Close Multiple Issues or Pull Requests - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202653-74b36480-e2af-11eb-9395-422657cce37a.jpg) | ![Comment and Close Multiple Issues or Pull Requests - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202654-754bfb00-e2af-11eb-9d70-61dcc7096dd5.jpg) |\n\nMultiple issues will be closed.\n\n![Comment and Close Multiple Issues or Pull Requests - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202656-754bfb00-e2af-11eb-98e8-526e7a235fe0.jpg)\n\n### Lock or Unlock issue or Pull Request\n\n[Source](https://github.com/peaceiris/actions-label-commenter/blob/v1.10.0/.github/label-commenter-config.yml#L73-L97)\n\n![Lock or Unlock issue or Pull Request - peaceiris/actions-label-commenter GitHub Action](https://user-images.githubusercontent.com/30958501/125202657-75e49180-e2af-11eb-8358-64aa65459a8d.jpg)\n\n\u003cdiv align=\"right\"\u003e\n\u003ca href=\"#table-of-contents\"\u003eBack to TOC ☝️\u003c/a\u003e\n\u003c/div\u003e\n\n\n\n## Changelog\n\n- [CHANGELOG.md](./CHANGELOG.md)\n\n\n\n## License\n\n- [MIT License - peaceiris/actions-label-commenter](https://github.com/peaceiris/actions-label-commenter/blob/main/LICENSE)\n\n\n\n## Maintainer\n\n- [peaceiris homepage](https://peaceiris.com/)\n\n\u003cdiv align=\"right\"\u003e\n\u003ca href=\"#table-of-contents\"\u003eBack to TOC ☝️\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeaceiris%2Factions-label-commenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeaceiris%2Factions-label-commenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeaceiris%2Factions-label-commenter/lists"}