Merge pull request #11069 from backstage/blam/smol-twekas

Adding some relevant documentation links to `app-config.yaml`
This commit is contained in:
Ben Lambert
2022-04-26 11:40:45 +02:00
committed by GitHub
3 changed files with 23 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/create-app': patch
---
Added a link to the `${GITHUB_TOKEN}` to document how to generate a token
+16 -6
View File
@@ -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.
<img src='../assets/getting-started/gh-pat.png' alt='Screenshot of the GitHub Personal Access Token creation page' />
</p>
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/)
@@ -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