Skip to content

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