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

hooks for gist #10

Open
steveb85 opened this issue Jan 13, 2022 · 4 comments
Open

hooks for gist #10

steveb85 opened this issue Jan 13, 2022 · 4 comments

Comments

@steveb85
Copy link

this plugin works great in our workflow for our gits, but I was wondering if there is a way to have it work for gists as well? In the file system the gists do have a hooks folder, but i don’t think this plugin supports them?

@marshalhayes
Copy link
Owner

I'm actually not sure about this. I guess you're wanting to run a hook when a gist is updated/created?

@steveb85
Copy link
Author

yes exactly @marshalhayes . in the .gitbucket/gist folder each gist does have a hooks folder, so it’s potentially possible, just wondering if it’s a simple implementation or not.

@marshalhayes
Copy link
Owner

I'm looking at the gist plugin now and it looks like this might be doable.

On the gist controller, there are two actions that are interesting:

  • a post to create a new gist (see here)
  • a post to update an existing gist (see here)

They both ultimately end up committing any changes.

I think the real question to ask here is whether or not, when the Gist plugin commits these changes, does GitBucket call the receiveHooks defined in Plugin.scala?

Out of curiosity, have you tried setting up a post-receive hook for a gist already? It might just work.

@steveb85
Copy link
Author

@marshalhayes i did try it when I discovered the hooks folder within the gists, but didn’t get anything, I didn’t go too deep because I assumed it didn’t work as no one had mentioned it, I can do some more thorough testing if you like.

I think the updating is the only thing you ant to worry about, when you create a gist you can’t have a hook, because it doesn’t exist u til it’s saved, so perhaps it could be simple, but also require input from the gist plugin?

Thanks for checking it out!

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

2 participants