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

Static parameter warning #164

Merged
merged 7 commits into from
Sep 14, 2017
Merged

Static parameter warning #164

merged 7 commits into from
Sep 14, 2017

Conversation

ivanpesin
Copy link
Contributor

@ivanpesin ivanpesin commented Aug 26, 2017

I have added the logic to produce log warning if static command line parameters are specified in 'execute-command' (issue #151):

"execute-command": "/bin/echo test"

will produce:

[webhook] 2017/08/25 23:31:55 unable to locate command: '/bin/echo test'
[webhook] 2017/08/25 23:31:55 use 'pass-arguments-to-command' to specify args for '/bin/echo'

Let me know if you want me to do it in a different way.

@ivanpesin ivanpesin changed the base branch from master to development August 26, 2017 15:42
log.Printf("unable to locate command: '%s'", h.ExecuteCommand)

// check if parameters specified in execute-command by mistake
if strings.IndexByte(h.ExecuteCommand, ' ') != -1 {
Copy link
Contributor

@gdubicki gdubicki Aug 27, 2017

Choose a reason for hiding this comment

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

This way of checking it will log a false alarm for binaries with spaces in their names.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, nvm, it will not.

@adnanh
Copy link
Owner

adnanh commented Sep 9, 2017

Looks great! If you could add some tests for this feature, I would be more than glad to merge it in! Thanks.

@ivanpesin
Copy link
Contributor Author

ivanpesin commented Sep 11, 2017

@adnanh I've added tests for this feature -- let me know if they look fine.

Thanks.

@simplenotezy
Copy link

It's not documented anywhere how to use "pass-arguments-to-command"

@moorereason
Copy link
Collaborator

@simplenotezy,
In the future, please don't comment on issues that were closed years ago. Open a new issue.

To answer your question, see the Github example at https://github.com/adnanh/webhook/blob/master/docs/Hook-Examples.md#incoming-github-webhook

Repository owner locked as resolved and limited conversation to collaborators Aug 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants