Gotcha: changing the 'name' of a GitHub App changes its slug

The GitHub logo, with an Octocat next to it

When using GitHub Apps, something that may catch you out is that the GitHub App doesn't have a separate "display name", so the name you choose to be presented to users is the same as the "slug".

For example, my app Jamie Tanna's Renovate Testing:

A screenshot of the GitHub App Jamie Tanna's Renovate Testing in the App settings UI. You can see the text box "GitHub App name" which is filled in, and underneath it says "The name of your GitHub App.". In the browser address bar, you can see the URL is https://github.com/settings/apps/jamie-tanna-s-renovate-testing, showing the slug is jamie-tanna-s-renovate-testing

In this case, any Issues/PRs/etc from that App will come from jamie-tanna-s-renovate-testing[bot], as we can also see via the API:

$ gh api /apps/jamie-tanna-s-renovate-testing
{
  "id": 2034350,
  "client_id": "Iv23liFUMWwksmiflxtK",
  "slug": "jamie-tanna-s-renovate-testing",
  ...
  "name": "Jamie Tanna's Renovate Testing",
  ...
}

The real gotcha - and something I've fed back to GitHub - is that GitHub will derive the "slug" from the "name".

This means that if I want to change the punctuation in my App name to maybe remove the apostrophe in Jamie Tanna's (even though that would be grammatically incorrect), this would mean that this would rename the app's slug, too:

A similar screenshot to the above screenshot of the GitHub App Jamie Tannas Renovate Testing (notice no apostrophe) in the App settings UI. In the browser address bar, you can see the URL is https://github.com/settings/apps/jamie-tannas-renovate-testing, showing the slug now removes a hyphen, resulting in jamie-tannas-renovate-testing

This hasn't caught me out since the first time I saw this, but after some conversations earlier I thought I'd write it up as a form of blogumentation.

Written by Jamie Tanna's profile image Jamie Tanna on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

This blog post is 100% human-written, and has nothing derived from LLMs (be it code, editorial support or prose).

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.