apache / openwhisk-catalog

Curated catalog of Apache OpenWhisk packages to interface with event producers and consumers
https://openwhisk.apache.org/
Apache License 2.0
33 stars 49 forks source link

Add a new parameter to GitHub webhook feed in order to allow usage with GitHub Enterprise #320

Closed fribechi closed 3 years ago

fribechi commented 3 years ago

At the moment Github webhook only works with public GitHub version since it has harcoded the GitHub api endpoint as "http://github.com". Adding a further parameter to make this able to be modified will enlarge the group of people using this feed. For instance such a parameter might be named githubApi and to have github.com as default to prevent any change in implementations using current version of the feed. In github doc we can find that in case of GitHub Enterprise is https://[hostname]/api/v3 ie https://github.myenterprise.com/api/v3. Thus just modifying the binding for this package in this way:

wsk package bind /whisk.system/github myGit \
  --param githubApi github.myenterprise.com/api/v3
  --param username myGitUser \
  --param repository myGitRepo \
  --param accessToken aaaaa1111a1a1a1a1a111111aaaaaa1111aa1a1a

anything will work correctly even in github enterprise

dgrove-oss commented 3 years ago

Fixed by #321