Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    5 Posts 3 Posters 16 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jw
      last edited by

      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
          }]
      }
      
      1 Reply Last reply Reply Quote 0
      • Dan_WoolfD Offline
        Dan_Woolf inedo-engineer
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • J Offline
          jw
          last edited by

          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.)?

          stevedennisS 1 Reply Last reply Reply Quote 0
          • stevedennisS Offline
            stevedennis inedo-engineer @jw
            last edited by

            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

            1 Reply Last reply Reply Quote 0
            • J Offline
              jw
              last edited by

              Ok, thanks for the information.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation