Skip to content

GIT push & Pull requests example workflow#22

Open
Ivan Zolotuhin (ivanzolotuhin) wants to merge 1 commit into
JetBrains:masterfrom
ivanzolotuhin:master
Open

GIT push & Pull requests example workflow#22
Ivan Zolotuhin (ivanzolotuhin) wants to merge 1 commit into
JetBrains:masterfrom
ivanzolotuhin:master

Conversation

@ivanzolotuhin

Copy link
Copy Markdown

There is no git events related workflow example in the repo and luck of examples in public internet.
Used this article as starting point https://habr.com/ru/company/JetBrains/blog/512880/

@oleg-larshin oleg-larshin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
It is possible to get newly added pull requests with the added collection:
ctx.issue.pullRequests.added
(see Set for more info)

Also, you can create a local variable and use the switch statement to make the code more compact:

var issue = ctx.issue;
var fs = issue.fields;
switch(issue.pullRequests.added.first().state.name) {
  case "OPEN":
    fs.State = ctx.State.Review;
    break;
  ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants