diff --git a/.changeset/stale-pigs-reply.md b/.changeset/stale-pigs-reply.md new file mode 100644 index 0000000000..645648c93f --- /dev/null +++ b/.changeset/stale-pigs-reply.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Added a link to the `${GITHUB_TOKEN}` to document how to generate a token diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md index e7d100f410..9db1f7f958 100644 --- a/docs/getting-started/configuration.md +++ b/docs/getting-started/configuration.md @@ -203,7 +203,7 @@ could read: The GitHub integration supports loading catalog entities from GitHub or GitHub Enterprise. Entities can be added to static catalog configuration, registered with the catalog-import plugin, or discovered from a GitHub organization. Users -and Groups can also be loaded from an organization. While using GitHub Apps +and Groups can also be loaded from an organization. While using [GitHub Apps](../integrations/github/github-apps.md) might be the best way to set up integrations, for this tutorial you'll use a Personal Access Token. @@ -217,21 +217,31 @@ for 7 days, it's a lucky number. Screenshot of the GitHub Personal Access Token creation page

-Set the scope to your likings. For this tutorial, selecting "repo" and "workflow" is required as the scaffolding job in this guide configures a GitHub actions workflow for the newly created project. -enough. +Set the scope to your likings. For this tutorial, selecting `repo` and `workflow` is required as the scaffolding job in this guide configures a GitHub actions workflow for the newly created project. -In the `app-config.yaml`, search for `integrations:` and add your token, like we -did in below example: +For this tutorial, we will be writing the token to `app-config.local.yaml`. This file might not exist for you, so if it doesn't go ahead and create it alongside the `app-config.yaml` at the root of the project. +This file should also be excluded in `.gitignore`, to avoid accidental committing of this file. + +In your `app-config.local.yaml` go ahead and add the following: ```yaml integrations: github: - host: github.com - token: ghp_urtokendeinfewinfiwebfweb + token: ghp_urtokendeinfewinfiwebfweb # this should be the token from GitHub ``` That's settled. This information will be leveraged by other plugins. +If you're looking for a more production way to manage this secret, then you can do the following with the token being stored in an environment variable called `GITHUB_TOKEN`. + +```yaml +integrations: + github: + - host: github.com + token: ${GITHUB_TOKEN} # this will use the environment variable GITHUB_TOKEN +``` + Some helpful links, for if you want to learn more about: - [Other available integrations](../integrations/) diff --git a/packages/create-app/templates/default-app/app-config.yaml.hbs b/packages/create-app/templates/default-app/app-config.yaml.hbs index d56a1beb76..e274ffeaf2 100644 --- a/packages/create-app/templates/default-app/app-config.yaml.hbs +++ b/packages/create-app/templates/default-app/app-config.yaml.hbs @@ -54,6 +54,8 @@ backend: integrations: github: - host: github.com + # This is a Personal Access Token or PAT from GitHub. You can find out how to generate this token, and more information + # about setting up the GitHub integration here: https://backstage.io/docs/getting-started/configuration#setting-up-a-github-integration token: ${GITHUB_TOKEN} ### Example for how to add your GitHub Enterprise instance using the API: # - host: ghe.example.net