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

Add support for naming env variables #75

Merged
merged 9 commits into from
May 26, 2016
Merged

Conversation

faide
Copy link
Contributor

@faide faide commented May 26, 2016

Hi, I added support for a new config variable that enables the user to name the environment variable its program will receive.

It is especially useful for source=string and for source=entire-payload schemes

[
  {
    "id": "push",
    "execute-command": "bb2mm",
    "command-working-directory": "/tmp",
    "pass-environment-to-command":
    [
      {
        "source": "entire-payload",
        "envname": "PAYLOAD"
      },
      {
        "source": "string",
        "name": "PUSH"
      },
      {
        "source": "string",
        "envname": "MMURL",
        "name": "https://someurl/hooks/somehooktokengeneratedbymm"
      }
    ]
  }
]

will give you nice env variables:

  • HOOK_PAYLOAD (using the introduced feature)
  • HOOK_MMURL (using the introduced feature)
  • HOOK_PUSH

without this feature the obtained vars are:

  • HOOK_ (it has no name and thus is not named :/ )
  • HOOK_https://someurl/hooks/somehooktokengeneratedbymm (the name is also the content and thus you won't be able to find this variable without knowing its content first, which kind of defeats the purpose)

@adnanh adnanh merged commit 18b0573 into adnanh:development May 26, 2016
@adnanh
Copy link
Owner

adnanh commented May 26, 2016

Thank you very much for your contribution and making webhook a better tool. :-)

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