Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Variable with package url for webhook



  • Hi,

    is there a variable that contains either the base url to the webinterface or the full url to a package that can be used in webhooks?

    I've created a message card with a clickable link like shown below. The only thing that I currently have to hardcode is the base url to the ProGet webinterface.

    Is there a better way to do this?

    {
        "@type": "MessageCard",
        "@context": "http://schema.org/extensions",
    	  "title": "$FeedType $PackageId $PackageVersion was $WebhookEvent",
        "summary": "summary",
        "sections": [{
            "facts": [{
                "name": "User:",
                "value": "$UserName"
            }, {
                "name": "Link:",
                "value": "[$PackageId $PackageVersion](http://192.168.0.1:8624/feeds/$FeedName/$PackageId/$PackageVersion)"
            }, {
                "name": "Feed:",
                "value": "$FeedName"
            }],
            "markdown": true
        }]
    }
    

  • inedo-engineer

    Hi @lm,

    We currently do not have a variable for the base URL. Unfortunately, this is not a trivial thing to implement either. The best solution is to hard code your base URL as you are currently doing in your webhook.

    Thanks,
    Dan



  • For my specific use case an URL to the package would already be sufficient. Could that be made available easier? The code that executes these hooks already must have some context of the package (Id, Version, etc.)?


  • inedo-engineer

    Hi @lm,

    Unfortunately it's not trivial to get a reliable URL for the package within the webhook module/code now, so it's not something that's easy to add on our end. The URL you have works for NuGet, but for other formats (Ruby, Debian, etc.) you need to include more information I believe.

    After v2023, where we plan to centralize a lot of this, it might be easier to reconsider this. But for now, what you have is the best/easiest solution.

    Cheers,
    Steve



  • Ok, thanks for the information.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation