Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GIT push & Pull requests example workflow #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivanzolotuhin
Copy link

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/

Copy link

@oleg-larshin oleg-larshin left a comment

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