Allow configuring autolink references at organization level #12386
Replies: 53 comments 15 replies
|
If you have quite a few repositories you'd like auto links for, the create an autolink reference for a repository REST API endpoint might be useful. |
|
Sorry for the bump here, any updates? |
|
It would be ideal if there was a configuration option available at the organization level for autolinking references |
|
@github-staff Any update on this? This would be a very useful feature. |
|
Hi Team, Any update on this? |
|
I don't know the internals, but a cheap alternative may be to allow file based configuration in something like |
|
This would still be a great feature. In our organisation we have 200+ repo's. |
🛑 Update about this solution 🛑As discovered by @s4nji, if your organization has a large number of repositories and/or you need to add a large number of autolink references, this solution probably won't work for you as you could easily hit GitHub's API rate limits. Check @s4nji's reply for more details. Original answer:I haven't tested it, but one option would be to use Terraform for this. You could fetch all repos of your org and then add the autolink references: locals {
projects = [
{
id = "TICKET"
url_template = "https://example.com/TICKET-<num>"
}
{
id = "PROJ"
url_template = "https://example.com/PROJ?query=<num>"
}
]
}
data "github_repositories" "your_org" {
query = "org:your_org"
}
resource "github_repository_autolink_reference" "autolink" {
for_each = {
for repo_project in setproduct(data.github_repositories.your_org.full_names, local.projects) : "repo:${repo_project[0]}|proj:${repo_project[1].id}" =>
{
repo_name = repo_project[0]
project_id = repo_project[1].id
project_url_template = repo_project[1].url_template
}
}
}
repository = each.value.repo_name
key_prefix = "${each.value.project_id}-"
target_url_template = each.value.project_url_template
}Besides having Terraform set up, a solution like this would require setting up authentication with GitHub using one of the available options and making sure the chosen option is authorized to see all your org's repos. References:
|
|
Until this feature is created, we decided to decouple auto links from Terraform as it leads to too many resources. Here is a gist I created with the script in Python if it helps anyone else. |
|
Adding another vote for this. I work for an organization that has over 7700 repositories in our GHE instance. This is a must for us to be able to make use of autolinks in a meaningful way. |
|
Adding my vote for this. You can do it on Gitlab #justsayin |
|
I was really surprised when found out that GH doesn't have a solution for this. Hope it'll be implemented soon |
|
+1 for this feature |
|
+1 for this feature |
|
Big up from here! |
|
It took only 3 years |
|
+1 |
|
+1 |
|
+1 |
|
+1 |
|
+1 |
|
Any hope for this to come into existence at the org or enterprise level? We have multiple orgs with thousands of repos. |
|
Have quite a few repos and it's currently cumbersome to set this up at a per repo basis. |
|
+1, can this please be looked at, been four years now! :( |
|
+1 |
|
+1 |
|
+1 |
|
ffs it's been 4 years |
|
+1 |
|
+1 |
Uh oh!
There was an error while loading. Please reload this page.
As an organization owner,
I would like to setup auto-link references at the organization settings level
so that my teammates do not have to re-create them across all projects we have
All reactions