vsoch / pull-request-action

open a pull request when a branch is pushed or updated
https://github.com/marketplace/actions/pull-request-action
MIT License
174 stars 62 forks source link

Enable author as assignee #54

Closed francoisaubert1 closed 3 years ago

francoisaubert1 commented 3 years ago

Hi there! What would you think of adding a variable to add author as assignee. For instance ASSIGN_AUTHOR_AS_ASSIGNEE ? Thank you for your work.

vsoch commented 3 years ago

hey @francoisaubert1 ! Since we have a variable that can be set in the environment for an assignee, it would be relatively straight forward to add a step to your workflow to handle this logic. I think you could just make a step that sets ‘${{ github.actor }} to be the PULL_REQUEST_ASSIGNEES. E.g., something like:

    steps:
      - name: pull-request-action
        uses: vsoch/pull-request-action@x.x.x
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PULL_REQUEST_ASSIGNEES: ${{ github.actor }}

You could also explicitly set the variable in a previous step, if the above doesn't work. Give that a shot and let me know!

francoisaubert1 commented 3 years ago

Indeed, works smoothly with the above solution... Thank you 👍