Hacktoberfest Action | DevsDay.ru

IT-блоги Hacktoberfest Action

dev.to 10 ноября 2021 г.


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/[email protected]
        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/[email protected]
        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

Источник: dev.to

Наш сайт является информационным посредником. Сообщить о нарушении авторских прав.

actionshackathon21 hacktoberfest opensource github