Hacktoberfest Action

My Workflow

I created my workflow by customizing the pr-labeler github action by TimonVS on github action marketplace. This workflow works by matching branch patterns name such that whenever a branch with matching pattern makes a pull reques…


This content originally appeared on DEV Community and was authored by Arya Narayan Tiwari

My Workflow

I created my workflow by customizing the pr-labeler github action by TimonVS on github action marketplace. This workflow works by matching branch patterns name such that whenever a branch with matching pattern makes a pull request and when that branch is merged and closed it adds the hacktoberfest and hacktoberfest-accepted label to the PRs, which automates the task for hacktoberfest maintainers to manually add the labels.

Example

When a pull request is closed with the branch name hack/218-add-emoji-support the Action will automatically apply the hacktoberfest and hacktoberfest-acccepted label once the PR is merged.

Submission Category: Maintainer Must-Haves

Yaml File or Link to Code

Github Repository Link

GitHub logo aryanarayantiwari / hacktoberfest-pr-labeler

This is a github action that adds hacktoberfest and hacktoberfest-accepted label to a merged pull request with matching branch name patterns.

Hacktoberfest Action

Merge pull request with ease

This is a github action made by using and customizing the pr-labeler github action by TimonVS from the github actions marketplace.

Features

  • Add labels to pull request with matching patterns in branch-name.
  • Automatically adds the lables once the PR is merged.
  • The current matching pattern for branchname is 'hack/*' but one can customise it by editing the 'pr-labeler.yml' file in .github folder.
  • Easy to Use
  • Automates the task of adding labels manually to a PR while merging during Hacktoberfest

Usage

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

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

jobs:
  pr-labeler:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
      - uses: TimonVS/pr-labeler-action@v3
        with:
          configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Configuration

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

For example:

hacktoberfest

Yaml File

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

jobs:
  pr-labeler:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
      - uses: TimonVS/pr-labeler-action@v3
        with:
          configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Additional Resources / Info

TimonVS PR-labeler


This content originally appeared on DEV Community and was authored by Arya Narayan Tiwari


Print Share Comment Cite Upload Translate Updates
APA

Arya Narayan Tiwari | Sciencx (2021-11-10T19:12:08+00:00) Hacktoberfest Action. Retrieved from https://www.scien.cx/2021/11/10/hacktoberfest-action/

MLA
" » Hacktoberfest Action." Arya Narayan Tiwari | Sciencx - Wednesday November 10, 2021, https://www.scien.cx/2021/11/10/hacktoberfest-action/
HARVARD
Arya Narayan Tiwari | Sciencx Wednesday November 10, 2021 » Hacktoberfest Action., viewed ,<https://www.scien.cx/2021/11/10/hacktoberfest-action/>
VANCOUVER
Arya Narayan Tiwari | Sciencx - » Hacktoberfest Action. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/10/hacktoberfest-action/
CHICAGO
" » Hacktoberfest Action." Arya Narayan Tiwari | Sciencx - Accessed . https://www.scien.cx/2021/11/10/hacktoberfest-action/
IEEE
" » Hacktoberfest Action." Arya Narayan Tiwari | Sciencx [Online]. Available: https://www.scien.cx/2021/11/10/hacktoberfest-action/. [Accessed: ]
rf:citation
» Hacktoberfest Action | Arya Narayan Tiwari | Sciencx | https://www.scien.cx/2021/11/10/hacktoberfest-action/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.