vsoch / pull-request-action

open a pull request when a branch is pushed or updated

Home Page:https://github.com/marketplace/actions/pull-request-action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for assigning reviewers

satishjuvo88 opened this issue · comments

Currently, my use case is to create automated PRs and set the reviewers. However, I wish that there is someway to retrieve the title and message as how github does when we open a PR. Title is the title of the first commit and message is the message of the first commit.

So you are interested in having a variable for the commit message? Note that commits don't really have a title, it would just be the first line of the commit message (and if I am wrong / misunderstand please show me an example so I know what you mean!)

you are correct, it is the first line of the commit message that im hoping to use as the title. I always use the first line to automatically make the title when i manually raise the PR such that I do not have to manually type the title.

If you want to set the title, then just set:

PULL_REQUEST_TITLE: the title for the pull request (optional)

and see the README for other variables.

PULL_REQUEST_TITLE: the title for the pull request (optional)

How do i make the title dynamic based on each PR's commit's last message?

currently if i entered

PULL_REQUEST_TITLE: test title

All PR will have 'test title' as the PR title, but i want the title to be pulled from the commit first line automatically and dynamically

You would run some pipeline step before it in your workflow and then set it as an environment variable to make available for the next step.

@vsoch just wanted to share that i eventually got the "github.event.head_commit.message" and split it with the seperator being '/n' and i got the PR Title as per when manually opening a PR :)

Oh interesting, so you wanted to get the commit message from the last commit already associated with the branch? Sorry I misunderstood, glad that you figured it out and that is for sharing the trick!

Actually, I am looking at the first commit's message.

Yes, my objective when i set out to use actions was to automate the whole process of opening a Pr when we push a branch to remote. So it needs to be exactly how i would open a PR when i click on the button on the webpage to open a PR and creating it.

Also, i had another question of whether we can assign teams to review using your actions?

There was another request to assign reviewers, but it wasn’t integrated. Would you be interested in this feature, and if so, would you be willing to test a PR branch? If so, I can make some time to work on it this week.

I would be delighted to help. i assume that to test a PR branch i just switch

    uses: vsoch/pull-request-action@master

to

    uses: vsoch/pull-request-action@PR-branch

right?

Yes, you got the idea! I have some triage (higher up in the list) things I need to work on, but I can definitely get this done for you within likely the week! Let's open the issue again and rename to be appropriate for this request.

okay here you go! I created an example config in the description here to get you started. Please test and let me know how it goes!

#23

Great, i will check it out.

hi, can i check if this will add assignee or reviewers? Also, does this include Team reviewers?

@satishjuvo88 I'm going to open a new issue to discuss this.