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
4 changes: 3 additions & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ jobs:
- id: update
name: "Update the dependency versions"
shell: pwsh
run: ./src/scripts/Update-Dependencies.ps1
run: ./src/scripts/Update-Dependencies.ps1 -AuthToken $env:GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: steps.update.outputs.has-changes == 'true' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
name: "Create a PR"
Expand Down
16 changes: 13 additions & 3 deletions src/scripts/Update-Dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#>
param (
$SourceRoot = "$PSScriptRoot/../..",
$GradleProperties = "$SourceRoot/gradle.properties"
$GradleProperties = "$SourceRoot/gradle.properties",
[string] $AuthToken = $null
)

Set-StrictMode -Version Latest
Expand All @@ -29,9 +30,18 @@ function ReadCurrentVersions
}
}

$requestHeaders = if ($AuthToken) {
@{ 'Authorization' = "Bearer $AuthToken" }
} else {
$null
}

$psScriptAnalyzer = Invoke-RestMethod `
'https://api.github.com/repos/PowerShell/PSScriptAnalyzer/releases?per_page=1'
$pses = Invoke-RestMethod 'https://api.github.com/repos/PowerShell/PowerShellEditorServices/releases?per_page=1'
-Headers $requestHeaders `
'https://api.github.com/repos/PowerShell/PSScriptAnalyzer/releases?per_page=1'
$pses = Invoke-RestMethod `
-Headers $requestHeaders `
'https://api.github.com/repos/PowerShell/PowerShellEditorServices/releases?per_page=1'

function ReadLatestVersions
{
Expand Down
Loading