Commit d863f36
authored
feat(git): support GITHUB_TOKEN env var as netrc auth fallback (#1156)
* feat(git): support GITHUB_TOKEN env var as netrc auth fallback
Adds a third auth path to setupGithubTokenNetrc, publish, and ensureGit
so platforms that inject a pre-provisioned installation token (e.g.
freestyle) can use HTTPS git auth without needing GITHUB_APP_CONFIGURED
or GITHUB_APP_KEY.
Priority order:
1. GITHUB_APP_CONFIGURED — self-provisions scoped tokens via GitHub App
2. GITHUB_APP_KEY — fetches token via admin API
3. GITHUB_TOKEN — writes the env var directly to ~/.netrc
Made-with: Cursor
* fix: let admin API token failure fall through to GITHUB_TOKEN
When GITHUB_APP_KEY is set but getGitHubToken() returns undefined (e.g.
admin API unavailable), the early return was silently skipping the
GITHUB_TOKEN fallback. Invert the check so a successful token
short-circuits while undefined falls through to the next branch.
Made-with: Cursor1 parent 4d91771 commit d863f36
1 file changed
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
252 | | - | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| |||
514 | 515 | | |
515 | 516 | | |
516 | 517 | | |
517 | | - | |
518 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
519 | 526 | | |
520 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
521 | 532 | | |
522 | 533 | | |
523 | 534 | | |
| |||
677 | 688 | | |
678 | 689 | | |
679 | 690 | | |
680 | | - | |
| 691 | + | |
681 | 692 | | |
682 | 693 | | |
683 | 694 | | |
| |||
686 | 697 | | |
687 | 698 | | |
688 | 699 | | |
689 | | - | |
| 700 | + | |
690 | 701 | | |
691 | 702 | | |
692 | 703 | | |
| |||
0 commit comments