GithubHelp home page GithubHelp logo

step-security / pr-labeler-action Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 563 KB

Automatically labels your PRs based on branch name patterns like feature/* or fix/*

License: MIT License

TypeScript 99.30% JavaScript 0.70%
step-security-maintained-actions

pr-labeler-action's Introduction

StepSecurity Maintained pr-labeler Action

Forked from TimonVS/pr-labeler-action

A GitHub Action that automatically applies labels to your PRs based on branch name patterns like feature/* or fix/*. Can be used in combination with Release Drafter to automatically categorize pull requests.

Usage

Add .github/workflows/pr-labeler.yml with the following:

name: PR Labeler
on:
  pull_request:
    types: [opened]

permissions:
  contents: read

jobs:
  pr-labeler:
    permissions:
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: step-security/pr-labeler-action@v5
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value

Configuration

Configure by creating a .github/pr-labeler.yml file.

For example:

feature: ['feature/*', 'feat/*']
fix: fix/*
chore :hammer:: chore/*

Then if a pull request is opened with the branch name feature/218-add-emoji-support the Action will automatically apply the feature label.

Similarly, if a pull requests is opened with the branch name fix/weird-bug or chore/annual-refactoring-job, the Action will apply the fix or chore ๐Ÿ”จ label, respectively.

If the label does not exist in your repo, a new one will be created (with no color and blank description), but it will not be permanently saved to the github.com/<your_repo>/labels page.

Wildcard branches in configuration

You can use * as a wildcard for matching multiple branch names. See https://www.npmjs.com/package/matcher for more information about wildcard options.

Default configuration

When no configuration is provided, the following defaults will be used:

feature: ['feature/*', 'feat/*']
fix: 'fix/*'
chore: 'chore/*'

pr-labeler-action's People

Contributors

varunsh-coder avatar dependabot[bot] avatar shubham-stepsecurity avatar ashishkurmi avatar step-security-bot avatar

Stargazers

Jeffrey Clark avatar

Watchers

 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.