Commit451 / skyhook

Parses webhooks and forwards them in the proper format to Discord.
https://commit451.github.io/skyhook-web
MIT License
365 stars 94 forks source link

New Provider: Azure DevOps #187

Closed wh1337 closed 1 year ago

wh1337 commented 2 years ago

Look in Discord:

image

dscalzi commented 2 years ago

are we only intending to support the push event? Azure devops (afaik) is a full git service.

wh1337 commented 2 years ago

Ah, for some reason Azure calls them service hooks, versus webhooks so I missed the service hooks entirely.

https://docs.microsoft.com/en-us/azure/devops/service-hooks/events?view=azure-devops

I'll get those updated and added to the PR. Sorry about that.

dscalzi commented 2 years ago

Take your time, make sure it's tested.

wh1t3lord commented 2 years ago

Can you add this wrapper for Azure pipelines? Seems all is fine. I mean add for the site.

RudeySH commented 2 years ago

What's the status of this PR? Will it work for push events if merged?

RudeySH commented 1 year ago

Currently, the provider puts markdown in the title of the embed, which has the following ugly result:

image

When you change this.body.message.markdown to this.body.message.text, it will have the following result:

image

Still not perfect though, but this is because DevOps puts a link in parentheses in the text variant of the message. Here's the raw JSON that comes from Azure DevOps:

  "message": {
    "text": "RudeySH pushed updates to SteamHunters:main\r\n(https://dev.azure.com/steamhunters/Steam%20Hunters/_git/SteamHunters/#version=GBmain)",
    "html": "RudeySH pushed updates to <a href=\"https://dev.azure.com/steamhunters/Steam%20Hunters/_git/SteamHunters/\">SteamHunters</a>:<a href=\"https://dev.azure.com/steamhunters/Steam%20Hunters/_git/SteamHunters/#version=GBmain\">main</a>",
    "markdown": "RudeySH pushed updates to [SteamHunters](https://dev.azure.com/steamhunters/Steam%20Hunters/_git/SteamHunters/):[main](https://dev.azure.com/steamhunters/Steam%20Hunters/_git/SteamHunters/#version=GBmain)"
  },

Maybe we should remove this link from the message using regex?


On a sidenote, is it intended that git tag events are also picked up?

image