All Projects â†’ dessant â†’ label-actions

dessant / label-actions

Licence: MIT license
🤖 GitHub Action that performs certain tasks when issues, pull requests or discussions are labeled or unlabeled

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to label-actions

Github Issue Templates
🔣 A collection of GitHub issue and pull request templates
Stars: ✭ 3,074 (+5023.33%)
Mutual labels:  issues, pull-request, issue
issue-states
GitHub Action that closes or reopens issues when they are moved to a project column
Stars: ✭ 64 (+6.67%)
Mutual labels:  issues, close, github-actions
new-issue
A fully customizable Github issues interface. Setup for your repo today!
Stars: ✭ 22 (-63.33%)
Mutual labels:  issues, issue
prepare-commit-msg
Automatically prefix commit messages with the current branch issue number
Stars: ✭ 28 (-53.33%)
Mutual labels:  issues, issue
dependent-issues
📦 A GitHub Action for marking issues as dependent on another
Stars: ✭ 83 (+38.33%)
Mutual labels:  issues, label
Repo Lockdown
GitHub Action that immediately closes and locks issues and pull requests
Stars: ✭ 56 (-6.67%)
Mutual labels:  issues, lock
Lock Threads
GitHub Action that locks closed issues and pull requests after a period of inactivity
Stars: ✭ 156 (+160%)
Mutual labels:  issues, lock
action-pr-title
Github action to enforce Pull Request title conventions
Stars: ✭ 83 (+38.33%)
Mutual labels:  pull-request, github-actions
aloba
🤖 [Myrmica Aloba 🐜] Bot: Add labels and milestone on pull requests and issues.
Stars: ✭ 18 (-70%)
Mutual labels:  issues, github-actions
assign-author
GitHub Actions to assign author to issue or PR
Stars: ✭ 55 (-8.33%)
Mutual labels:  issues, github-actions
universe2021
All things GitHub Universe 2021!
Stars: ✭ 112 (+86.67%)
Mutual labels:  discussions, github-actions
actions
Collection of repetitive GitHub Actions
Stars: ✭ 12 (-80%)
Mutual labels:  pull-request, github-actions
github-pr-diff-tree
🌲 This action provide a comment that displays the diff of the pull request in a tree format.
Stars: ✭ 31 (-48.33%)
Mutual labels:  pull-request, github-actions
no-free-usage-action
A NO-FREE-USAGE action for github. (Only worked with github action.)
Stars: ✭ 51 (-15%)
Mutual labels:  issue, github-actions
issue-bot
GitHub Actions powered Issue Bot 🦾
Stars: ✭ 62 (+3.33%)
Mutual labels:  issues, github-actions
nrwl-nx-action
A GitHub Action to wrap Nrwl Nx commands in your workflows.
Stars: ✭ 163 (+171.67%)
Mutual labels:  pull-request, github-actions
ghissue
🙌 Bulk-upload GitHub Issues
Stars: ✭ 22 (-63.33%)
Mutual labels:  issues
basicLibPP
A powerful library for inline-hook,lock,compress etc,and it is useful for anti-virus software.
Stars: ✭ 15 (-75%)
Mutual labels:  lock
TAOMP
《多处理器编程的艺术》一书中的示例代码实现,带有注释与单元测试
Stars: ✭ 39 (-35%)
Mutual labels:  lock
TheWorldExchange
A purely client-side wallet and direct interface showcasing the full functionality of Ripple / blockchain.
Stars: ✭ 34 (-43.33%)
Mutual labels:  issue

Label Actions

Label Actions is a GitHub bot that performs certain actions when issues, pull requests or discussions are labeled or unlabeled.

Supporting the Project

The continued development of Label Actions is made possible thanks to the support of awesome backers. If you'd like to join them, please consider contributing with Patreon, PayPal or Bitcoin.

How It Works

The bot performs certain actions when an issue, pull request or discussion is labeled or unlabeled. No action is taken by default and the bot must be configured. The following actions are supported:

  • Post comments
  • Add labels
  • Remove labels
  • Close threads
  • Reopen threads
  • Lock threads with an optional lock reason
  • Unlock threads

Usage

  1. Create the .github/workflows/label-actions.yml workflow file, use one of the example workflows to get started
  2. Create the .github/label-actions.yml configuration file based on the example below
  3. Start labeling issues, pull requests and discussions

Inputs

The bot can be configured using input parameters.

  • github-token
    • GitHub access token, value must be ${{ github.token }} or an encrypted secret that contains a personal access token
    • Optional, defaults to ${{ github.token }}
  • config-path
    • Configuration file path
    • Optional, defaults to .github/label-actions.yml
  • process-only
    • Process label events only for issues, pull requests or discussions, value must be a comma separated list, list items must be one of issues, prs or discussions
    • Optional, defaults to ''

Configuration

Labels and actions are specified in a configuration file. Actions are grouped under label names, and a label name can be prepended with a - sign to declare actions taken when a label is removed from a thread. Actions can be overridden or declared only for issues, pull requests or discussions by grouping them under the issues, prs or discussions key.

Actions

  • comment
    • Post comments, value must be either a comment or a list of comments, {issue-author} is an optional placeholder
    • Optional, defaults to ''
  • label
    • Add labels, value must be either a label or a list of labels
    • Optional, defaults to ''
  • unlabel
    • Remove labels, value must be either a label or a list of labels
    • Optional, defaults to ''
  • close
    • Close threads, value must be either true or false, ignored for discussions
    • Optional, defaults to false
  • reopen
    • Reopen threads, value must be either true or false, ignored for discussions
    • Optional, defaults to false
  • lock
    • Lock threads, value must be either true or false
    • Optional, defaults to false
  • lock-reason
    • Reason for locking threads, value must be one of resolved, off-topic, too heated or spam, ignored for discussions
    • Optional, defaults to ''
  • unlock
    • Unlock threads, value must be either true or false
    • Optional, defaults to false

Examples

The following workflow will perform the actions specified in the .github/label-actions.yml configuration file when an issue, pull request or discussion is labeled or unlabeled.

name: 'Label Actions'

on:
  issues:
    types: [labeled, unlabeled]
  pull_request:
    types: [labeled, unlabeled]
  discussion:
    types: [labeled, unlabeled]

permissions:
  contents: read
  issues: write
  pull-requests: write
  discussions: write

jobs:
  action:
    runs-on: ubuntu-latest
    steps:
      - uses: dessant/label-actions@v2

Available input parameters

This workflow declares all the available input parameters of the app and their default values. Any of the parameters can be omitted.

name: 'Label Actions'

on:
  issues:
    types: [labeled, unlabeled]
  pull_request:
    types: [labeled, unlabeled]
  discussion:
    types: [labeled, unlabeled]

permissions:
  contents: read
  issues: write
  pull-requests: write
  discussions: write

jobs:
  action:
    runs-on: ubuntu-latest
    steps:
      - uses: dessant/label-actions@v2
        with:
          github-token: ${{ github.token }}
          config-path: '.github/label-actions.yml'
          process-only: ''

Ignoring label events

This step will process label events only for issues.

    steps:
      - uses: dessant/label-actions@v2
        with:
          process-only: 'issues'

This step will process label events only for pull requests and discussions.

    steps:
      - uses: dessant/label-actions@v2
        with:
          process-only: 'prs, discussions'

Unnecessary workflow runs can be avoided by removing the events that trigger workflows from the workflow file instead.

on:
  issues:
    types: labeled

Configuring labels and actions

Labels and actions are specified in a configuration file. The following example showcases how desired actions may be declared:

# Configuration for Label Actions - https://github.com/dessant/label-actions

# The `heated` label is added to issues, pull requests or discussions
heated:
  # Post a comment
  comment: >
    The thread has been temporarily locked.
    Please follow our community guidelines.
  # Lock the thread
  lock: true
  # Set a lock reason
  lock-reason: 'too heated'
  # Additionally, add a label to pull requests
  prs:
    label: 'on hold'

# The `heated` label is removed from issues, pull requests or discussions
-heated:
  # Unlock the thread
  unlock: true

# The `wontfix` label is removed from issues
-wontfix:
  issues:
    # Reopen the issue
    reopen: true

# The `feature` label is added to issues
feature:
  issues:
    # Post a comment, `{issue-author}` is an optional placeholder
    comment: >
      :wave: @{issue-author}, please use our idea board to request new features.
    # Close the issue
    close: true

# The `wip` label is added to pull requests
wip:
  prs:
    # Add labels
    label:
      - 'on hold'
      - 'needs feedback'

# The `wip` label is removed from pull requests
-wip:
  prs:
    # Add label
    label: 'needs QA'
    # Remove labels
    unlabel:
      - 'on hold'
      - 'needs feedback'

# The `solved` label is added to discussions
solved:
  discussions:
    # Lock the discussion
    lock: true

# The `pizzazz` label is added to issues, pull requests or discussions
pizzazz:
  # Post comments
  comment:
    - '![](https://i.imgur.com/WuduJNk.jpg)'
    - '![](https://i.imgur.com/1D8yxOo.gif)'

Using a personal access token

The action uses an installation access token by default to interact with GitHub. You may also authenticate with a personal access token to perform actions as a GitHub user instead of the github-actions app.

Create a personal access token with the repo or public_repo scopes enabled, and add the token as an encrypted secret for the repository or organization, then provide the action with the secret using the github-token input parameter.

    steps:
      - uses: dessant/label-actions@v2
        with:
          github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

License

Copyright (c) 2019-2021 Armin Sebastian

This software is released under the terms of the MIT License. See the LICENSE file for further information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].