Skip to content

Support template compilation for sourceUrl #35974

@rarkins

Description

@rarkins

Discussed in #35153

Originally posted by chris3ware April 2, 2025

How are you running Renovate?

A Mend.io-hosted app

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

No response

Please tell us more about your question or problem

I would like to see the release notes for OpenTofu provider updates in the PRs. I noticed in the log output that there isn't a sourceUrl, like there is for github-actions, for example, which do have release notes in the PRs.

I have tried to add a sourceUrl to the terraform-provider datasource in packageRules using a template to construct the github URL using the packageName:

{
  "matchDatasources": [
    "terraform-provider"
    ],
    "enabled": true,
    "registryUrls": [
      "https://registry.opentofu.org"
    ],
  // sourceUrl required for release notes. This should be the URL of the provider's GitHub repository
  // Example from renovate docs https://docs.renovatebot.com/templates/#split
  // {{ lookup (split packageName '-') 1 }}
  // packageName: "hashicorp/aws" should be "hashicorp/terraform-provider-aws" for example

  "sourceUrl": "https://github.com/{{ lookup (split packageName '/') 0 }}/terraform-provider-{{ lookup (split packageName '/') 1) }}"
}

The screenshot below shows the value in the pull request (this is a private repo - so I cannot share the link. I can replicate in a public repo if required).

Screenshot 2025-04-02 at 16 26 09

Is it possible to use the Template syntax to achieve this?

Logs (if relevant)

Logs

DEBUG: Fetching changelog: https://github.com/{{ lookup (split packageName '/') 0 }}/terraform-provider-{{ lookup (split packageName '/') 1 }} (5.91.0 -> 5.93.0) (branch="renovate/aws-5.x")
DEBUG: Invalid github URL found: https://github.com/{{ lookup (split packageName '/') 0 }}/terraform-provider-{{ lookup (split packageName '/') 1 }} (branch="renovate/aws-5.x")

Reproduction forked to https://github.com/renovate-reproductions/35153

Metadata

Metadata

Assignees

No one assigned

    Labels

    core:configRelated to config capabilities and presetspriority-3-mediumDefault priority, "should be done" but isn't prioritised ahead of others

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions