{"id":13482646,"url":"https://github.com/dessant/label-actions","last_synced_at":"2025-04-12T15:34:44.562Z","repository":{"id":46640045,"uuid":"167173644","full_name":"dessant/label-actions","owner":"dessant","description":"🤖 GitHub Action that performs certain tasks when issues, pull requests or discussions are labeled or unlabeled","archived":false,"fork":false,"pushed_at":"2024-08-02T22:55:24.000Z","size":1280,"stargazers_count":112,"open_issues_count":8,"forks_count":13,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-29T10:45:09.579Z","etag":null,"topics":["close","comment","discussions","github-actions","issue","issues","label","lock","pull-request","unlabel"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/label-actions","language":"JavaScript","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/dessant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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":"dessant","patreon":"dessant","custom":["https://armin.dev/go/paypal","https://armin.dev/go/bitcoin"]}},"created_at":"2019-01-23T11:42:51.000Z","updated_at":"2024-10-08T14:33:31.000Z","dependencies_parsed_at":"2023-11-21T16:29:44.638Z","dependency_job_id":"a7f8e4ff-ff26-4399-b375-9a8815deae20","html_url":"https://github.com/dessant/label-actions","commit_stats":{"total_commits":71,"total_committers":2,"mean_commits":35.5,"dds":"0.15492957746478875","last_synced_commit":"102faf474a544be75fbaf4df54e73d3c515a0e65"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dessant%2Flabel-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dessant%2Flabel-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dessant%2Flabel-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dessant%2Flabel-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dessant","download_url":"https://codeload.github.com/dessant/label-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590007,"owners_count":21129726,"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":["close","comment","discussions","github-actions","issue","issues","label","lock","pull-request","unlabel"],"created_at":"2024-07-31T17:01:04.039Z","updated_at":"2025-04-12T15:34:44.519Z","avatar_url":"https://github.com/dessant.png","language":"JavaScript","funding_links":["https://github.com/sponsors/dessant","https://patreon.com/dessant","https://armin.dev/go/paypal","https://armin.dev/go/bitcoin"],"categories":["JavaScript"],"sub_categories":[],"readme":"# Label Actions\n\nLabel Actions is a GitHub bot that performs certain actions when issues,\npull requests or discussions are labeled or unlabeled.\n\n\u003cimg width=\"800\" src=\"https://raw.githubusercontent.com/dessant/label-actions/main/assets/screenshot.png\"\u003e\n\n## Supporting the Project\n\nThe continued development of Label Actions is made possible\nthanks to the support of awesome backers. If you'd like to join them,\nplease consider contributing with\n[Patreon](https://armin.dev/go/patreon?pr=label-actions\u0026src=repo),\n[PayPal](https://armin.dev/go/paypal?pr=label-actions\u0026src=repo) or\n[Bitcoin](https://armin.dev/go/bitcoin?pr=label-actions\u0026src=repo).\n\n## How It Works\n\nThe bot performs certain actions when an issue, pull request or discussion\nis labeled or unlabeled. No action is taken by default and the bot\nmust be configured. The following actions are supported:\n\n- Post comments\n- Add labels\n- Remove labels\n- Close threads\n- Reopen threads\n- Lock threads\n- Unlock threads\n\n## Usage\n\n1. Create the `.github/workflows/label-actions.yml` workflow file,\n   use one of the [example workflows](#examples) to get started\n2. Create the `.github/label-actions.yml` configuration file\n   based on the [example](#configuring-labels-and-actions) below\n3. Start labeling issues, pull requests and discussions\n\n### Inputs\n\nThe bot can be configured using [input parameters](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepswith).\n\n\u003c!-- prettier-ignore --\u003e\n- **`github-token`**\n  - GitHub access token, value must be `${{ github.token }}` or an encrypted\n    secret that contains a [personal access token](#using-a-personal-access-token)\n  - Optional, defaults to `${{ github.token }}`\n- **`config-path`**\n  - Configuration file path\n  - Optional, defaults to `.github/label-actions.yml`\n- **`process-only`**\n  - Process label events only for issues, pull requests or discussions,\n    value must be a comma separated list, list items must be\n    one of `issues`, `prs` or `discussions`\n  - Optional, defaults to `''`\n\n### Configuration\n\nLabels and actions are specified in a configuration file.\nActions are grouped under label names, and a label name can be prepended\nwith a `-` sign to declare actions taken when a label is removed\nfrom a thread. Actions can be overridden or declared only for issues,\npull requests or discussions by grouping them under the\n`issues`, `prs` or `discussions` key.\n\n#### Actions\n\n\u003c!-- prettier-ignore --\u003e\n- **`comment`**\n  - Post comments, value must be either a comment or a list of comments,\n    `{issue-author}` is an optional placeholder\n  - Optional, defaults to `''`\n- **`label`**\n  - Add labels, value must be either a label or a list of labels\n  - Optional, defaults to `''`\n- **`unlabel`**\n  - Remove labels, value must be either a label or a list of labels\n  - Optional, defaults to `''`\n- **`close`**\n  - Close threads, value must be either `true` or `false`\n  - Optional, defaults to `false`\n- **`close-reason`**\n  - Reason for closing threads, value must be:\n    - `completed` or `not planned` for issues\n    - `duplicate`, `outdated` or `resolved` for discussions\n  - Ignored for pull requests\n  - Optional, defaults to `''`\n- **`reopen`**\n  - Reopen threads, value must be either `true` or `false`\n  - Optional, defaults to `false`\n- **`lock`**\n  - Lock threads, value must be either `true` or `false`\n  - Optional, defaults to `false`\n- **`lock-reason`**\n  - Reason for locking threads, value must be one\n    of `resolved`, `off-topic`, `too heated` or `spam`\n  - Ignored for discussions\n  - Optional, defaults to `''`\n- **`unlock`**\n  - Unlock threads, value must be either `true` or `false`\n  - Optional, defaults to `false`\n\n## Examples\n\nThe following workflow will perform the actions specified\nin the `.github/label-actions.yml` configuration file when an issue,\npull request or discussion is labeled or unlabeled.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\nname: 'Label Actions'\n\non:\n  issues:\n    types: [labeled, unlabeled]\n  pull_request_target:\n    types: [labeled, unlabeled]\n  discussion:\n    types: [labeled, unlabeled]\n\npermissions:\n  contents: read\n  issues: write\n  pull-requests: write\n  discussions: write\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/label-actions@v4\n```\n\n### Available input parameters\n\nThis workflow declares all the available input parameters of the app\nand their default values. Any of the parameters can be omitted.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\nname: 'Label Actions'\n\non:\n  issues:\n    types: [labeled, unlabeled]\n  pull_request_target:\n    types: [labeled, unlabeled]\n  discussion:\n    types: [labeled, unlabeled]\n\npermissions:\n  contents: read\n  issues: write\n  pull-requests: write\n  discussions: write\n\njobs:\n  action:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/label-actions@v4\n        with:\n          github-token: ${{ github.token }}\n          config-path: '.github/label-actions.yml'\n          process-only: ''\n```\n\n### Ignoring label events\n\nThis step will process label events only for issues.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n    steps:\n      - uses: dessant/label-actions@v4\n        with:\n          process-only: 'issues'\n```\n\nThis step will process label events only for pull requests and discussions.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n    steps:\n      - uses: dessant/label-actions@v4\n        with:\n          process-only: 'prs, discussions'\n```\n\nUnnecessary workflow runs can be avoided by removing the events\nthat trigger workflows from the workflow file instead.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\non:\n  issues:\n    types: labeled\n```\n\n### Configuring labels and actions\n\nLabels and actions are specified in a YAML configuration file.\nThe following example showcases how desired actions may be declared:\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n# Configuration for Label Actions - https://github.com/dessant/label-actions\n\n# The `heated` label is added to issues, pull requests or discussions\nheated:\n  # Post a comment\n  comment: \u003e\n    The thread has been temporarily locked.\n    Please follow our community guidelines.\n  # Lock the thread\n  lock: true\n  # Set a lock reason\n  lock-reason: 'too heated'\n  # Additionally, add a label to pull requests\n  prs:\n    label: 'pr: on hold'\n\n# The `heated` label is removed from issues, pull requests or discussions\n-heated:\n  # Unlock the thread\n  unlock: true\n\n# The `wontfix` label is removed from issues\n-wontfix:\n  issues:\n    # Reopen the issue\n    reopen: true\n\n# The `feature` label is added to issues\nfeature:\n  issues:\n    # Post a comment, `{issue-author}` is an optional placeholder\n    comment: \u003e\n      :wave: @{issue-author}, please use our idea board to request new features.\n    # Close the issue\n    close: true\n    # Set a close reason\n    close-reason: 'not planned'\n\n# The `qa: needed` label is added to pull requests\n'qa: needed':\n  prs:\n    # Add labels\n    label:\n      - 'qa: l10n'\n      - 'pr: on hold'\n\n\n# The `qa: needed` label is removed from pull requests\n'-qa: needed':\n  prs:\n    # Add label\n    label: 'qa: verified'\n    # Remove labels\n    unlabel:\n      - 'qa: l10n'\n      - 'pr: on hold'\n\n# The `solved` label is added to discussions\nsolved:\n  discussions:\n    # Close the discussion\n    close: true\n    # Set a close reason\n    close-reason: 'resolved'\n    # Lock the discussion\n    lock: true\n\n# The `pizzazz` label is added to issues, pull requests or discussions\npizzazz:\n  # Post comments\n  comment:\n    - '![](https://i.imgur.com/WuduJNk.jpg)'\n    - '![](https://i.imgur.com/1D8yxOo.gif)'\n```\n\n### Using a personal access token\n\nThe action uses an installation access token by default to interact with GitHub.\nYou may also authenticate with a personal access token to perform actions\nas a GitHub user instead of the `github-actions` app.\n\nCreate a [personal access token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)\nwith the `repo` or `public_repo` scopes enabled, and add the token as an\n[encrypted secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository)\nfor the repository or organization, then provide the action with the secret\nusing the `github-token` input parameter.\n\n\u003c!-- prettier-ignore --\u003e\n```yaml\n    steps:\n      - uses: dessant/label-actions@v4\n        with:\n          github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}\n```\n\n## License\n\nCopyright (c) 2019-2023 Armin Sebastian\n\nThis software is released under the terms of the MIT License.\nSee the [LICENSE](LICENSE) file for further information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdessant%2Flabel-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdessant%2Flabel-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdessant%2Flabel-actions/lists"}