action-dependabot-auto-merge icon indicating copy to clipboard operation
action-dependabot-auto-merge copied to clipboard

Feature to add labels to auto-merged PR

Open reminjp opened this issue 2 years ago • 2 comments

Hello. I request a feature to add labels to auto-merged PR.

In a workflow in my project, after a PR is merged by action-dependabot-auto-merge, another step adds a "automerge" label. This is a bit wasteful and complex.

reminjp avatar Oct 14 '21 06:10 reminjp

interesting idea, but I don't think I'll work on adding that myself, but if you make a pull request with the functionality, i'll happily review it and ultimately merge it

ahmadnassri avatar Oct 14 '21 13:10 ahmadnassri

Thanks.

I have another idea to achieve my goal (adding labels to auto-merged PR), so I'm wondering which way is good for the action-dependabot-auto-merge.

  • Receive labels as a new input of this action. Write some code to add labels in this action.
  • Output matched, will-auto-merge, or something (any good naming?) from this action. Subsequent steps look at the output and decide whether to add labels to the PR. (see below)
    steps:
      - uses: actions/checkout@v2
      - uses: ahmadnassri/action-dependabot-auto-merge@v2
        id: dependabot-auto-merge
        with:
          target: minor
          github-token: ${{ secrets.mytoken }}
      - name: Add a label
        if: steps.dependabot-auto-merge.outputs.will-auto-merge == 'true'
        run: gh pr edit --add-label 'automerge'

I think the second way is easy to implement and is better for alternate or more general needs. Do you have any good ideas?

reminjp avatar Oct 15 '21 15:10 reminjp