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

Run when a pull request is closed #71

Closed
nictrix opened this issue Jan 23, 2019 · 4 comments
Closed

Run when a pull request is closed #71

nictrix opened this issue Jan 23, 2019 · 4 comments

Comments

@nictrix
Copy link

nictrix commented Jan 23, 2019

I would like to get everyone's thoughts on triggering when a PR is closed. It doesn't appear this resource can do that right now, only on commits.

Reason being when a PR is created I'd like an action to happen and when the PR is merged/closed I'd like the opposite action to happen. An example of this would be creating a review environment while the PR is open, then terminate it when the PR is merged/closed. I could always run terminate when there is a commit to master, though having multiple PRs would break that ability.

If there are other ways outside of having the github-pr-resource send triggers on PR actions let me know...

@shinmyung0
Copy link

I actually wrote a resource for this very problem, if you want to take a look at it.

https://github.com/shinmyung0/pullrequest-events-resource

@itsdalmo
Copy link
Contributor

I think for this particular use case it makes sense to use something like what @shinmyung0 has created, since github-pr-resource tracks the commits within a PR and not the state of the PR itself :)

@nictrix
Copy link
Author

nictrix commented Jan 28, 2019

@shinmyung0 awesome! Thanks for this!
@itsdalmo I'm okay with closing this issue since there is already a resource that handles it and it makes sense for it to be separate.

@nictrix nictrix closed this as completed Jan 28, 2019
@shinmyung0
Copy link

shinmyung0 commented Jan 29, 2019

@nictrix I even wrote a medium article on the process of writing the resource, so if you want an easy way to understand the code or even fork/contribute to it take a look:
“Writing a Custom Resource for Concourse— Detecting Pull Request Close/Merge Events” by Shin Myung Yoon https://link.medium.com/g2bI0iPkRT

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

No branches or pull requests

3 participants