GithubHelp home page GithubHelp logo

wow-actions_label-commands's Introduction

Label Commands

Perform commands when issues or pull requests are labeled or unlabeled

How It Works

This Github Action performs certain commands when an issue or pull request is labeled or unlabeled. The following commands are supported:

  • Post a comment (comment and reactions option)
  • Close (close option)
  • Reopen (open option)
  • Lock with an optional lock reason (lock and lockReason options)
  • Unlock (unlock option)
  • Pin (pin option, pin an issue)
  • UnPin (unpin option, unpin an issue)
  • Add or remove labels (labels option), label prefixed with - will be removed, other label will be added. Support array of labels or space separated labels.

Usage

Create .github/workflows/label-commands.yml in the default branch:

name: Label Commands
on:
  pull_request:
    types: [labeled, unlabeled]
  issues:
    types: [labeled, unlabeled]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/label-commands@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CONFIG_FILE: your-config-file-path # .github/workflows/config/label-commands.yml

Inputs

Various inputs are defined to let you configure the action:

Note: Workflow command and parameter names are not case-sensitive.

  • GITHUB_TOKEN: Your GitHub token for authentication.
  • CONFIG_FILE: Path to configuration file. Custom config will deep merged with the following default config:
# Specify commands for issues and pull requests
# ---------------------------------------------

# Actions taken when the `heated` label is added
heated:
  # Lock the thread
  lock: true
  # Set a lock reason, such as `off-topic`, `too heated`, `resolved` or `spam`
  lockReason: too heated
  # Reactions to be added to comment
  reactions: ['eyes', 'heart']
  # Post a comment
  comment: >
    The thread has been temporarily locked.
    
    Please follow our community guidelines.


# Actions taken when the `heated` label is removed
-heated:
  # Unlock the thread
  unlock: true

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


  -wontfix:
    # Reopen the issue
    open: true

  needs-more-info:
    # Close the issue
    close: true
    comment: >
      In order to communicate effectively, we have a certain format requirement for the issue, your issue is automatically closed because there is no recurring step or reproducible warehouse, and will be REOPEN after the offer.


  -needs-more-info:
    # Reopen the issue
    open: true

# Optionally, specify commands just for pull requests
# ---------------------------------------------------
pulls:

License

The scripts and documentation in this project are released under the MIT License

wow-actions_label-commands's People

Contributors

bubkoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.