From c3fcd3808ae5a24fb733593d9a8fb3570c92d433 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 19 Aug 2024 22:59:14 +0200 Subject: [PATCH 1/5] - Using Process-PSModule v3 - Remove nuget from Dependabot settings --- .github/dependabot.yml | 4 ---- .github/workflows/Nightly-Run.yml | 2 +- .github/workflows/Process-PSModule.yml | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b92544a..f57e1e9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,3 @@ updates: directory: / # Location of package manifests schedule: interval: weekly - - package-ecosystem: nuget # See documentation for possible values - directory: / # Location of package manifests - schedule: - interval: weekly diff --git a/.github/workflows/Nightly-Run.yml b/.github/workflows/Nightly-Run.yml index d5b5994..4f56d30 100644 --- a/.github/workflows/Nightly-Run.yml +++ b/.github/workflows/Nightly-Run.yml @@ -10,5 +10,5 @@ permissions: jobs: Process-PSModule: - uses: PSModule/Process-PSModule/.github/workflows/CI.yml@v2 + uses: PSModule/Process-PSModule/.github/workflows/CI.yml@v3 secrets: inherit diff --git a/.github/workflows/Process-PSModule.yml b/.github/workflows/Process-PSModule.yml index b98ed7c..3d77d85 100644 --- a/.github/workflows/Process-PSModule.yml +++ b/.github/workflows/Process-PSModule.yml @@ -25,5 +25,5 @@ permissions: jobs: Process-PSModule: - uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v2 + uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v3 secrets: inherit From 8bd84b1963f847bc07521b7b434f8543ae01624d Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 19 Aug 2024 23:23:25 +0200 Subject: [PATCH 2/5] - Restructure for v3 --- src/{GraphQL => functions}/public/Get-PSModule.ps1 | 0 src/{GraphQL => functions}/public/New-PSModule.ps1 | 0 src/{GraphQL => functions}/public/Set-PSModule.ps1 | 0 src/{GraphQL => functions}/public/Test-PSModule.ps1 | 0 src/{GraphQL => }/header.ps1 | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename src/{GraphQL => functions}/public/Get-PSModule.ps1 (100%) rename src/{GraphQL => functions}/public/New-PSModule.ps1 (100%) rename src/{GraphQL => functions}/public/Set-PSModule.ps1 (100%) rename src/{GraphQL => functions}/public/Test-PSModule.ps1 (100%) rename src/{GraphQL => }/header.ps1 (100%) diff --git a/src/GraphQL/public/Get-PSModule.ps1 b/src/functions/public/Get-PSModule.ps1 similarity index 100% rename from src/GraphQL/public/Get-PSModule.ps1 rename to src/functions/public/Get-PSModule.ps1 diff --git a/src/GraphQL/public/New-PSModule.ps1 b/src/functions/public/New-PSModule.ps1 similarity index 100% rename from src/GraphQL/public/New-PSModule.ps1 rename to src/functions/public/New-PSModule.ps1 diff --git a/src/GraphQL/public/Set-PSModule.ps1 b/src/functions/public/Set-PSModule.ps1 similarity index 100% rename from src/GraphQL/public/Set-PSModule.ps1 rename to src/functions/public/Set-PSModule.ps1 diff --git a/src/GraphQL/public/Test-PSModule.ps1 b/src/functions/public/Test-PSModule.ps1 similarity index 100% rename from src/GraphQL/public/Test-PSModule.ps1 rename to src/functions/public/Test-PSModule.ps1 diff --git a/src/GraphQL/header.ps1 b/src/header.ps1 similarity index 100% rename from src/GraphQL/header.ps1 rename to src/header.ps1 From 808a248c9b15b18d2cd96789c53ed39d97df603a Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 20 Aug 2024 23:02:31 +0200 Subject: [PATCH 3/5] Fix permissions on CI --- .github/workflows/Nightly-Run.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Nightly-Run.yml b/.github/workflows/Nightly-Run.yml index 4f56d30..c25d806 100644 --- a/.github/workflows/Nightly-Run.yml +++ b/.github/workflows/Nightly-Run.yml @@ -7,6 +7,8 @@ on: permissions: contents: read + pull-requests: write + statuses: write jobs: Process-PSModule: From aa1161886c441f9a559ee3d38eb435583705a4e6 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 20 Aug 2024 23:46:16 +0200 Subject: [PATCH 4/5] disable markdown and yaml prettier linter --- .github/workflows/Linter.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Linter.yml b/.github/workflows/Linter.yml index 5c9f300..d7650ae 100644 --- a/.github/workflows/Linter.yml +++ b/.github/workflows/Linter.yml @@ -27,3 +27,5 @@ jobs: uses: super-linter/super-linter@latest env: GITHUB_TOKEN: ${{ github.token }} + VALIDATE_MARKDOWN_PRETTIER: false + VALIDATE_YAML_PRETTIER: false From 94f7bedf974dc73a12b1f7c6d832055d96645457 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 22 Aug 2024 00:14:54 +0200 Subject: [PATCH 5/5] Fix --- examples/General.ps1 | 19 ------------------- src/functions/public/New-PSModule.ps1 | 22 ---------------------- src/functions/public/Set-PSModule.ps1 | 22 ---------------------- src/functions/public/Test-PSModule.ps1 | 18 ------------------ src/header.ps1 | 3 --- tests/GraphQL.Tests.ps1 | 13 ++++++------- 6 files changed, 6 insertions(+), 91 deletions(-) delete mode 100644 examples/General.ps1 delete mode 100644 src/functions/public/New-PSModule.ps1 delete mode 100644 src/functions/public/Set-PSModule.ps1 delete mode 100644 src/functions/public/Test-PSModule.ps1 delete mode 100644 src/header.ps1 diff --git a/examples/General.ps1 b/examples/General.ps1 deleted file mode 100644 index e193423..0000000 --- a/examples/General.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -<# - .SYNOPSIS - This is a general example of how to use the module. -#> - -# Import the module -Import-Module -Name 'PSModule' - -# Define the path to the font file -$FontFilePath = 'C:\Fonts\CodeNewRoman\CodeNewRomanNerdFontPropo-Regular.tff' - -# Install the font -Install-Font -Path $FontFilePath -Verbose - -# List installed fonts -Get-Font -Name 'CodeNewRomanNerdFontPropo-Regular' - -# Uninstall the font -Get-Font -Name 'CodeNewRomanNerdFontPropo-Regular' | Uninstall-Font -Verbose diff --git a/src/functions/public/New-PSModule.ps1 b/src/functions/public/New-PSModule.ps1 deleted file mode 100644 index fcea178..0000000 --- a/src/functions/public/New-PSModule.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -function New-PSModule { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Test-PSModule -Name 'World' - - "Hello, World!" - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', - Justification = 'Reason for suppressing' - )] - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/functions/public/Set-PSModule.ps1 b/src/functions/public/Set-PSModule.ps1 deleted file mode 100644 index 4677cf3..0000000 --- a/src/functions/public/Set-PSModule.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -function Set-PSModule { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Test-PSModule -Name 'World' - - "Hello, World!" - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', - Justification = 'Reason for suppressing' - )] - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/functions/public/Test-PSModule.ps1 b/src/functions/public/Test-PSModule.ps1 deleted file mode 100644 index 5be2c11..0000000 --- a/src/functions/public/Test-PSModule.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -function Test-PSModule { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Test-PSModule -Name 'World' - - "Hello, World!" - #> - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/header.ps1 b/src/header.ps1 deleted file mode 100644 index cc1fde9..0000000 --- a/src/header.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Justification = 'Contains long links.')] -[CmdletBinding()] -param() diff --git a/tests/GraphQL.Tests.ps1 b/tests/GraphQL.Tests.ps1 index 71b33de..da22862 100644 --- a/tests/GraphQL.Tests.ps1 +++ b/tests/GraphQL.Tests.ps1 @@ -1,11 +1,10 @@ Describe 'GraphQL' { - Context 'Module' { - It 'The module should be available' { - Get-Module -Name 'GraphQL' -ListAvailable | Should -Not -BeNullOrEmpty - Write-Verbose (Get-Module -Name 'GraphQL' -ListAvailable | Out-String) -Verbose - } - It 'The module should be importable' { - { Import-Module -Name 'GraphQL' } | Should -Not -Throw + Context 'Get-PSModule' { + It 'should greet the world' { + $Name = 'World' + $Expected = "Hello, $Name!" + $Actual = Get-PSModule -name $Name + $Actual | Should -Be $Expected } } }