Closed brandon-kyle-bailey closed 4 years ago
hey @brandon-kyle-bailey - I'd be happy to help you with this! Let's walk through each component one step at a time.
We can look at output for the action to see what variables it is seeing:
In the above I see that the pull request title is set to this commit
Pull request title is Merge pull request #54 from brandon-kyle-bailey/issue#37
And for the assignee, I see:
PULL_REQUEST_ASSIGNEES is set, Brandon
So from the above I'd say that your Title is working correctly, but for assignee you are using your GitHub "name" and not the "login" (if I remember correctly). Could you find the page where the payload is described and verify what field has the username? You would need to change this line:
PULL_REQUEST_ASSIGNEES: ${{github.event.head_commit.author.name}}
to something else. I don't remember off the top of my head, but I'd use something like sender.login. A nice approach for debugging like this is to add a step where you can print additional variables you are interested in (if the action doesn't do it for you, which this one does.)
steps:
- name: pull-request-action
env:
PULL_REQUEST_TITLE: ${{github.event.head_commit.message}}
PULL_REQUEST_ASSIGNEES: ${{github.event.head_commit.author.name}}
runs: |
echo "${PULL_REQUEST_TITLE}"
echo "${PULL_REQUEST_ASSIGNEES}"
So that should be enough I think for you to at least get started. If you would like to do a test run and echo those variables, and then direct me to the Action output where they are printed (and the action fails) I'd be happy to take a look. Also keep in mind that assignees and reviewers need to have admin on the repo, or be someone that you could assign manually in the interface (all other cases are ignored).
the title variable seems to pick up extra information in the commit message.
If you are setting your title to be the commit message:
PULL_REQUEST_TITLE: ${{github.event.head_commit.message}}
I don't think this should be a surprise. If you want to cut / truncate or otherwise edit it, you would need to insert another run statement before the action to set that environment variable, and then set it again in the run for the next action (changed).
Hey @vsoch ,
Thanks for getting back to me. I'll run another test with your advice and get back to you.
Regarding the ASSIGNEES:
If i point you to this action : this action
You can see:
PULL_REQUEST_ASSIGNEES is set, brandon-kyle-bailey bot
In a previous test of this action file, i had the following code:
PULL_REQUEST_ASSIGNEES: "brandon-kyle-bailey bot"
Which is a space separated string as suggested by the documentation. This also failed to set any ASSIGNEES once the PR was created.
Is there something i'm missing in the workflow? should the PR be created in draft mode?
Thanks again for your help
Thanks for linking me to the action! That example that you linked this time around is correct usage. I see the issue - the dashes are not being properly parsed:
I'll see if I can reproduce locally and update the action to address. Stay tuned!
Thanks for linking me to the action! That example that you linked this time around is correct usage. I see the issue - the dashes are not being properly parsed:
I'll see if I can reproduce locally and update the action to address. Stay tuned!
Wow, i really should start wearing my glasses when i read logs lol... Thanks for looking in to that. in the mean time, i can attempt to escape the dashes and see if that works!
Yep @vsoch , no luck with escaping special characters. I guess i found an annoying edge case?
You found a very interesting case actually! I came down to a difference in the sed that is on my local machine vs. GitHub actions, and the fix was to parse it another way. I've opened a PR with branch fix/assignee-reviewer-parsing
to test this change, linked above, #33, would you care to update your current testing PR with that branch (e.g., vsoch/pull-request-action@fix/assignee-reviewer-parsing) and then link me to the action run, and we can go from there?
Awesome! So happy to hear! I'll get the PR merged and a release drafted asap for you to use! I think this will be 1.0.6. Be back soon!
Amazing, you're a saint. Thanks for the swift resolution !
okay all set! The release is out https://github.com/vsoch/pull-request-action/releases/tag/1.0.6 so you should get the same functionality with 1.0.6. I'm also going to be deleting the PR branch so be sure to update your test with the release version.
And you are so sweet! Always happy to help :) Happy pull requesting!
Hi,
Have an issue that im not sure how to approach for a solution.
problem:
example:
code:
I have tried setting the assignees manually with:
to no avail.
Does anyone have any ideas?
Thanks,