Skip to content

Commit d37110d

Browse files
Caleb BroseCaleb Brose
Caleb Brose
authored and
Caleb Brose
committed
Update PAT usage
1 parent 1a3692d commit d37110d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

action.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ $convertRootReadmeToHomePage = Get-ActionInput convertRootReadmeToHomePage
1616
$useHeaderForWikiName = Get-ActionInput useHeaderForWikiName
1717

1818
$repositoryName = $env:GITHUB_REPOSITORY
19-
$repositoryUrl = "https://github.com/$repositoryName"
19+
$repositoryUrl = "https://$githubToken@github.com/$repositoryName"
2020

21-
$wikiRepoName = "$repositoryName.wiki"
21+
$wikiRepoDirectory = ($repositoryName -split "/")[-1] + ".wiki"
2222
$wikiRepoUrl = "$repositoryUrl.wiki.git"
2323

2424
if (-not $defaultBranch) {
@@ -236,9 +236,9 @@ Function ProcessWikiFile()
236236

237237
Push-Location ..
238238
Write-Information "Cloning wiki repo..."
239-
git -c http.extraheader="AUTHORIZATION:bearer $githubToken" clone $wikiRepoUrl
240-
$wikiRepoPath = $pwd.Path + "/" + $wikiRepoName
241-
cd $wikiRepoName
239+
git clone $wikiRepoUrl
240+
$wikiRepoPath = $pwd.Path + "/" + $wikiRepoDirectory
241+
cd $wikiRepoDirectory
242242
git rm -rf * | Out-Null
243243
Pop-Location
244244

@@ -247,7 +247,7 @@ Write-Information "Processing source directory..."
247247
ProcessSourceDirectory
248248
Pop-Location
249249

250-
Push-Location ..\$wikiRepoName
250+
Push-Location ..\$wikiRepoDirectory
251251
Write-Information "Post-processing wiki files..."
252252
ProcessWikiDirectory
253253

0 commit comments

Comments
 (0)