Skip to content

muachilin/Pig

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Pig

Pig status

A tiny Github Action built with JavaScript for managing pull requests and issues 🎯

Let PIG make Pull requests and Issues Glue together 🥂

Stay home and play with Github :octocat:

🧭 Usage

Inputs

There are five inputs for Pig.

Input Required Default Description
github-token Yes x Simply use ${{ secrets.GITHUB_TOKEN }}. You don't need to set the token yourself.
in-progress-label-word No "in progress 🌱" The text of the label indicating that the issue is in progress.
in-progress-label-color No #ffc163 #ffc163 The color of the label indicating that the issue is in progress.
done-label-word No "done 🎉" The text of the label indicating that the issue is solved.
done-label-color No #c0ff33 #c0ff33 The color of the label indicating that the issue is solved.

Triggering Workflow

Since by default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened, be sure to include closed in the types of pull_request to trigger the action when merging the pull requests. See pull_request in Github Actions Reference for other activity types of pull request event.

Example of Usage

To configure your automated software development process in Github, you have to include workflows in the .github/workflows directory in the root of your repository. The following is the example of using pig-action in .github/workflows/my-workflow.yml. If you want to customize the color of done label, you need to use hexadecimal color code in lower case without the leading # mark.

name: 'My workflow'
on:
  pull_request:
    types: [assigned, opened, synchronize, reopened, edited, closed]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: pig-action
        uses: muachilin/Pig@0.0.8
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          in-progress-label-word: "handling"
          done-label-color: "ffff00"

🏷️ Labeling

When you commit to a branch and open a corresonding pull request, Pig will automatically add a label of in progress to the linked issue of this pull request.



Remember to include the number of linked issue in the title of the pull request in the parentheses

My pull request title (#123)

If you still forget to include the number of linked issue in the pull request title, don't worry. Pig will remind you.



✂️ Delabeling

After you merge the pull request, Pig will automatically remove the original in progress label and add the done label to the linked issue. Therefore, user can easily see which issues are already solved.



📝 Mentioning

When you commit to a branch and open a corresonding pull request, Pig will automatically comment on the linked issue of this pull request. Besides, Pig will tag the person who open the pull request on the linked issue. Therefore, user can see who and which PR is handling this issue very easily.