This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch fix/apidocs-automation
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/fix/apidocs-automation by this 
push:
     new ba47ff4dd docs.ps1: Added option to skip restore when done in CI
ba47ff4dd is described below

commit ba47ff4dd4aa7bf47ca1b6b8ff2b6c49acf20574
Author: Shad Storhaug <[email protected]>
AuthorDate: Thu Oct 24 10:55:24 2024 +0700

    docs.ps1: Added option to skip restore when done in CI
---
 .github/workflows/Lucene-Net-Documentation.yml |  2 +-
 websites/apidocs/docs.ps1                      | 15 +++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/Lucene-Net-Documentation.yml 
b/.github/workflows/Lucene-Net-Documentation.yml
index 6bd71f22d..5382bf7cb 100644
--- a/.github/workflows/Lucene-Net-Documentation.yml
+++ b/.github/workflows/Lucene-Net-Documentation.yml
@@ -138,7 +138,7 @@ jobs:
           echo "$HOME/.dotnet/tools" | Out-File -FilePath $env:GITHUB_PATH 
-Encoding utf8 -Append
 
       - name: Build docs
-        run: ./main-repo/websites/apidocs/docs.ps1 -Clean -LuceneNetVersion 
${{ env.RELEASE_VERSION }}
+        run: ./main-repo/websites/apidocs/docs.ps1 -Clean -SkipToolRestore 
-LuceneNetVersion ${{ env.RELEASE_VERSION }}
         shell: powershell
 
       - name: Checkout Lucene.Net website
diff --git a/websites/apidocs/docs.ps1 b/websites/apidocs/docs.ps1
index 9a3d09436..ba893483f 100644
--- a/websites/apidocs/docs.ps1
+++ b/websites/apidocs/docs.ps1
@@ -26,6 +26,7 @@ param (
     [switch] $DisableMetaData = $false,
     [switch] $DisableBuild = $false,
     [switch] $DisablePlugins = $false,
+    [switch] $SkipToolRestore = $false,
     # LogLevel can be: Diagnostic, Verbose, Info, Warning, Error
     [Parameter(Mandatory = $false)]
     [string] $LogLevel = 'Warning',
@@ -62,12 +63,14 @@ $TocPath1 = Join-Path -Path $ApiDocsFolder -ChildPath 
"toc.yml"
 $TocPath2 = Join-Path -Path $ApiDocsFolder -ChildPath "toc\toc.yml"
 $BreadcrumbPath = Join-Path -Path $ApiDocsFolder -ChildPath 
"docfx.global.subsite.json"
 
-# install docfx tool
-Write-Host "Restoring docfx tool..."
-$PreviousLocation = Get-Location
-Set-Location $RepoRoot
-dotnet tool restore
-Set-Location $PreviousLocation
+if ($SkipToolRestore -eq $false) {
+    # install docfx tool
+    Write-Host "Restoring docfx tool..."
+    $PreviousLocation = Get-Location
+    Set-Location $RepoRoot
+    dotnet tool restore
+    Set-Location $PreviousLocation
+}
 
 # delete anything that already exists
 if ($Clean) {

Reply via email to