Skip to content

Commit

Permalink
chore: Updated script, to fetch even more
Browse files Browse the repository at this point in the history
  • Loading branch information
samtrion committed May 16, 2024
1 parent 79e20e4 commit 45dcffc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/update-readme-packages.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
name: Update packages in README.md

on:
push:
branches:
- main
paths:
- scripts/update-packages.ps1

schedule:
# Run every day at 4:21 AM UTC
# https://crontab.guru/#21_4_*_*_*
- cron: '21 4 * * *'

workflow_dispatch:

jobs:
Expand Down
4 changes: 2 additions & 2 deletions scripts/update-packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Get-Packages {
Write-Host "Getting packages from Nuget"

$repositoryUrl = 'https://github.com/dailydevops'
$queryUrl = 'https://api-v2v3search-0.nuget.org/query?q=NetEvolve'
$queryUrl = 'https://api-v2v3search-0.nuget.org/query?q=NetEvolve&take=1000'
$response = Invoke-WebRequest -Uri $queryUrl
if ($response.statuscode -ne 200) {
Write-Error "Failed to get packages from $repositoryUrl"
Expand Down Expand Up @@ -38,7 +38,7 @@ function Get-Packages {
'@

foreach ($package in ($data.data | Sort-Object -Property id)) {
if (-Not $package.projectUrl.StartsWith($repositoryUrl)) {
if (-Not $package.id.StartsWith("NetEvolve.")) {
continue
}

Expand Down

0 comments on commit 45dcffc

Please sign in to comment.