Skip to content

Commit 99cc1d2

Browse files
Merge pull request #24 from StatusNeo/feature/readme
readme modified and bug fix
2 parents 3a60d43 + 3160b65 commit 99cc1d2

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ Now in the below steps, I will assume you are already done with the provider.
1919
```shell
2020
yarn add –cwd packages/app @statusneo/backstage-plugin-github
2121
```
22+
2. add this to the app/src/apis.ts
23+
24+
```javascript
25+
import { githubApiRef, GithubClient as StatusNeoGithubClient } from '@statusneo/backstage-plugin-github';
26+
27+
// ...
28+
createApiFactory({
29+
api: githubApiRef,
30+
deps: { authApi: githubAuthApiRef, fetchApi: fetchApiRef, configApi: configApiRef },
31+
factory(deps) {
32+
return new StatusNeoGithubClient(deps);
33+
},
34+
}),
35+
// ...
36+
```
2237

2338
2. Import `GithubPullRequestsCard`, and `GithubActionsCard` from the installed package.
2439

@@ -37,4 +52,13 @@ import { GithubPullRequestsCard, GithubActionsCard } from '@statusneo/backstage-
3752
// ...
3853
```
3954

55+
4. If you are using a GitHub enterprise edition, you can pass your instance url through app-config.yml
56+
57+
```yaml
58+
59+
gh-plugin:
60+
url: ${GITHUB_ENTERPRISE_URL}
61+
62+
```
63+
4064
Now you are ready to use this Backstage GitHub plugin to make your software management and development cycle a little more hassle-free.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@statusneo/backstage-plugin-github",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"main": "src/index.ts",
55
"types": "src/index.ts",
66
"license": "ISC",

src/api/GithubClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class GithubClient implements GithubApi {
3636
const query = new URLSearchParams(params);
3737

3838
const baseUrl: string =
39-
this.configApi.get('gh-plugin.url') || 'https://api.github.com/';
39+
this.configApi.getOptionalString('gh-plugin.url') || 'https://api.github.com/';
4040

4141
const url = new URL(
4242
`${path}?${query.toString().replaceAll('%2B', '+')}`,

0 commit comments

Comments
 (0)