From 2e5bb908509f3d0dfc370865ae49939d4c898af8 Mon Sep 17 00:00:00 2001 From: Tunisiano18 Date: Thu, 11 Apr 2024 19:01:54 +0200 Subject: [PATCH] Test GH --- .github/workflows/new-issue.yml | 2 +- scripts/Find-nextissueGH.ps1 | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 scripts/Find-nextissueGH.ps1 diff --git a/.github/workflows/new-issue.yml b/.github/workflows/new-issue.yml index 4f8723ef6..27140c18c 100644 --- a/.github/workflows/new-issue.yml +++ b/.github/workflows/new-issue.yml @@ -14,4 +14,4 @@ jobs: - uses: actions/checkout@v2.2.0 - name: Check exception run: | - . "${{ github.workspace }}\scripts\Find-nextissue.ps1" \ No newline at end of file + . "${{ github.workspace }}\scripts\Find-nextissueGH.ps1" -packageName ${{ github.event.issue.title }} \ No newline at end of file diff --git a/scripts/Find-nextissueGH.ps1 b/scripts/Find-nextissueGH.ps1 new file mode 100644 index 000000000..fdd88c89d --- /dev/null +++ b/scripts/Find-nextissueGH.ps1 @@ -0,0 +1,30 @@ +$ErrorActionPreference = 'Continue' +param( + [Parameter(Mandatory = $true)] + [string]$packageName +) + +Install-Module psgithubsearch -ErrorAction SilentlyContinue +Import-Module psgithubsearch + +[string]$Owner = "tunisiano187" +[string]$Repository = "Chocolatey-packages" + +Write-Output "Search the next package to import" +$search = $packageName +if($search) { + $folder = Join-Path $PSScriptRoot "../automatic/$search" + if(Test-Path $folder) { + Write-Warning "Package already in the folder, the package $search needs to be finished and the issue closed" + } elseif ($search -ne '') { + $script = Join-Path $PSScriptRoot "Get-Package.ps1" + . $script $search.Tolower() + } +} + +try { + git push origin master +} +catch { + "Nothing to push!" +}