fastlane / github-actions

MIT License
75 stars 7 forks source link

It is possible to remove a label from a pull request via `communicate-on-pull-request-merged` GitHub Action #27

Closed mollyIV closed 4 years ago

mollyIV commented 4 years ago

Description

The current bot πŸ€–on fastlane repository removes the status: needs-attention label from merged pull request:

    def process_closed_pr(pr, prs_to_releases)
      remove_needs_attention_from(pr) if has_label?(pr, NEEDS_ATTENTION)

communicate-on-pull-request-merged GitHub Action should do the same and this PR is introducing this functionality.

Testing

Manual testing

A workflow file used for a manual testing:

name: Processing pull requests
on: 
  pull_request:
    types: [closed]

jobs:   
  pr-release-lifecycle:
    name: PR release lifecycle
    runs-on: ubuntu-latest    
    steps:
      - name: Git checkout
        if: github.event.pull_request.merged
        uses: actions/checkout@master
        with:
          ref: refs/heads/master

      - name: Communicate on PR merged
        if: github.event.pull_request.merged
        uses: mollyIV/github-actions/communicate-on-pull-request-merged@remove-label-via-communicate-on-pr-merged
        with:
          repo-token: "${{ secrets.BOT_TOKEN }}"
          pr-comment: "Hello @${{ github.event.pull_request.user.login }} Thanks for your contribution!"
          pr-label-to-add: 'waiting-for-release'
          pr-label-to-remove: 'needs-attention'
Screen Shot 2019-12-14 at 20 53 02 Screen Shot 2019-12-14 at 20 54 09

My bot is set to my private account, that's why you see the comments from the author πŸ˜…

I also tested the action when there's no label added to the PR

image

🎊 🎊