Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<<CLIENT_ID>>", $env:CLIENT_ID
$content = $content -replace "<<CLIENT_SECRET>>", $env:CLIENT_SECRET
$content | Set-Content -Path $file -Force

- name: Publish to PowerShell Gallery
shell: pwsh
Expand Down
10 changes: 5 additions & 5 deletions src/PSBlogger.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
RootModule = 'PSBlogger.psm1'

# Version number of this module.
ModuleVersion = '0.2.0'
ModuleVersion = '0.3.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand All @@ -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'
Expand Down Expand Up @@ -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 = ''

Expand Down
2 changes: 1 addition & 1 deletion src/public/Add-GoogleDriveFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function Add-GoogleDriveFile {
[string]$FileName,

[Parameter()]
[string]$TargetFolderName = "Open Live Writer",
[string]$TargetFolderName = "PSBlogger",

[Parameter()]
[switch]$Force
Expand Down
4 changes: 3 additions & 1 deletion src/public/Get-GoogleDriveItems.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
7 changes: 3 additions & 4 deletions src/public/Initialize-Blogger.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<<CLIENT_ID>>",

[Parameter(HelpMessage = "Google API Client Secret")]
[string]$clientSecret = "PUK0j9ig-GHcSByQao2i1aIa",
[string]$clientSecret = "<<CLIENT_SECRET>>",

[Parameter(HelpMessage = "Redirect Uri specified in Google API Consent Form")]
[string]$redirectUri = "http://localhost/oauth2callback"
Expand All @@ -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 " "

Expand Down