Commit 7221ced
authored
feat: return repo
This PR is a follow-up to a missing step in the `fork` script initial
implementation at #3; the fork script failed to return a `repo` which
can be used to in the next step of computation. This was because of a
weird assumption I had during the initial implementation. 😆See my
assumption below...
> I assume that the call to the `"POST /repos/{owner}/{repo}/forks"`
endpoint only assures of initiating a fork process without assuring us
of a response at all. Meaning we might not exactly get a `response.data`
following the call
...but that wasn't true, I found out that a `response.data` actually
comes, but it might just take some time and only in cases where the repo
being forked is huge.... and at the moment forking the project repo
happens in less than 5secs.
### Changes Made
- Returned `fork` repo - this is a repo fullname value returned from the
`isRepositoryForked` helper function; I hereby return it as main
returned value from the `forkRepository` function execution in the
condition where the repo is already forked on a executing user's account
- Returned `response.data.full_name` - this is a newly created fork repo
fullname; Its a value from the response to the `"POST
/repos/{owner}/{repo}/forks"` endpoint call; I hereby return it as main
retuned value from the `forkRepository` function execution in cases
where there was no fork already already found on the executing user's
account
- Cherry picked some changes from #25 to use on here
- f12f25f
- 436ceea
📖fullname in fork script (#29)1 parent d3550d8 commit 7221ced
3 files changed
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 40 | + | |
45 | 41 | | |
46 | 42 | | |
47 | 43 | | |
| |||
0 commit comments