diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1058632..d011e86 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -186,6 +186,18 @@ jobs: if ($testResults.FailedCount -gt 0) { throw "Tests failed. Cannot publish to PowerShell Gallery." } + + - name: Inject Values into Module + shell: pwsh + env: + CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + run: | + $file = "./src/public/Initialize-Blogger.ps1" + $content = Get-Content $file -Raw + $content = $content -replace "<>", $env:CLIENT_ID + $content = $content -replace "<>", $env:CLIENT_SECRET + $content | Set-Content -Path $file -Force - name: Publish to PowerShell Gallery shell: pwsh diff --git a/src/PSBlogger.psd1 b/src/PSBlogger.psd1 index 33514f7..9353ac6 100644 --- a/src/PSBlogger.psd1 +++ b/src/PSBlogger.psd1 @@ -5,7 +5,7 @@ RootModule = 'PSBlogger.psm1' # Version number of this module. -ModuleVersion = '0.2.0' +ModuleVersion = '0.3.0' # Supported PSEditions # CompatiblePSEditions = @() @@ -20,7 +20,7 @@ Author = 'Bryan Cook' CompanyName = 'Bryan Cook' # Copyright statement for this module -Copyright = '#169; me' +# Copyright = '#169; me' # Description of the functionality provided by this module Description = 'Module to publish markdown files to Blogger' @@ -97,16 +97,16 @@ PrivateData = @{ Tags = 'blogger','markdown','pandoc' # A URL to the license for this module. - #LicenseUri = '' + LicenseUri = 'https://github.com/bryanbcook/PSBlogger?tab=MIT-1-ov-file#readme' # A URL to the main website for this project. - ProjectUri = 'http://www.bryancook.net/' + ProjectUri = 'https://github.com/bryanbcook/PSBlogger' # A URL to an icon representing this module. #IconUri = '' # ReleaseNotes of this module - #ReleaseNotes = '' + ReleaseNotes = 'https://github.com/bryanbcook/PSBlogger/releases' # Prerelease string of this module # Prerelease = '' diff --git a/src/public/Add-GoogleDriveFile.ps1 b/src/public/Add-GoogleDriveFile.ps1 index 66730ca..3b9cda4 100644 --- a/src/public/Add-GoogleDriveFile.ps1 +++ b/src/public/Add-GoogleDriveFile.ps1 @@ -30,7 +30,7 @@ function Add-GoogleDriveFile { [string]$FileName, [Parameter()] - [string]$TargetFolderName = "Open Live Writer", + [string]$TargetFolderName = "PSBlogger", [Parameter()] [switch]$Force diff --git a/src/public/Get-GoogleDriveItems.ps1 b/src/public/Get-GoogleDriveItems.ps1 index 9ee5e20..053e592 100644 --- a/src/public/Get-GoogleDriveItems.ps1 +++ b/src/public/Get-GoogleDriveItems.ps1 @@ -53,10 +53,12 @@ function Get-GoogleDriveItems { $q += "'$ParentId' in parents" } + $q += "trashed=false" # Exclude trashed items + $queryArgs = @{ q = [System.Web.HttpUtility]::UrlEncode($q -join ' and ') pageSize = 40 - } + } do { diff --git a/src/public/Initialize-Blogger.ps1 b/src/public/Initialize-Blogger.ps1 index ad41697..0983315 100644 --- a/src/public/Initialize-Blogger.ps1 +++ b/src/public/Initialize-Blogger.ps1 @@ -25,10 +25,10 @@ Initiate a login flow with Google Function Initialize-Blogger { Param( [Parameter(HelpMessage = "Google API ClientId")] - [string]$clientId = "284606892422-ribvo7oodlbtd70e8onn8rg4hm58mluj.apps.googleusercontent.com", + [string]$clientId = "<>", [Parameter(HelpMessage = "Google API Client Secret")] - [string]$clientSecret = "PUK0j9ig-GHcSByQao2i1aIa", + [string]$clientSecret = "<>", [Parameter(HelpMessage = "Redirect Uri specified in Google API Consent Form")] [string]$redirectUri = "http://localhost/oauth2callback" @@ -41,8 +41,7 @@ Function Initialize-Blogger { # specify the scopes we want in our auth token $scope = @( "https://www.googleapis.com/auth/blogger" - #"https://www.googleapis.com/auth/drive.file" # TODO: fix - "https://www.googleapis.com/auth/drive" + "https://www.googleapis.com/auth/drive.file" ) -join " "