From 6560607cd4da307fb5ad27fffd2dea28314394f3 Mon Sep 17 00:00:00 2001 From: Adam Weigert Date: Fri, 28 Oct 2022 20:17:17 -0400 Subject: [PATCH] updates for v1.0.0 --- .github/workflows/ci.yml | 1 - .github/workflows/release.yml | 6 +- README.md | 109 +--------------------------------- action.yml | 42 ------------- 4 files changed, 5 insertions(+), 153 deletions(-) delete mode 100644 action.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03dfd35..7be5b96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,6 @@ on: push: branches: [ main ] paths-ignore: - - action.yml - README.md - LICENSE - CODEOWNERS diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51358fe..c756e4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: smokedlinq/powershell-devops@v0 + - uses: powershell-devops/install-module@v1 - name: Install pre-requisites run: Install-Module Pester -MinimumVersion 5.2.0 -Force @@ -43,7 +43,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: smokedlinq/powershell-devops@v0 + - uses: powershell-devops/install-module@v1 - name: Publish to PowerShellGallery run: ./.github/workflows/scripts/publish.ps1 @@ -63,7 +63,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: smokedlinq/powershell-devops@v0 + - uses: powershell-devops/install-module@v0 - name: Unlist from PowerShellGallery run: ./.github/workflows/scripts/unlist.ps1 \ No newline at end of file diff --git a/README.md b/README.md index eb0c77f..8ad9b5c 100644 --- a/README.md +++ b/README.md @@ -1,115 +1,10 @@ # powershell-devops -![CI](https://github.com/smokedlinq/powershell-devops/workflows/ci/badge.svg) +![CI](https://github.com/powershell-devops/powershell-devops/workflows/ci/badge.svg) [![PowerShellGallery](https://img.shields.io/powershellgallery/dt/powershell-devops.svg)](https://www.powershellgallery.com/packages/powershell-devops) PowerShell module for dealing with commands in Azure DevOps Pipelines and GitHub Workflows. ## GitHub Action -See [action.yml](action.yml) for detailed list of inputs. - -Basic: - -```yml -steps: -- uses: smokedlinq/powershell-devops@v0 -``` - -Specific version: - -```yml -steps: -- uses: smokedlinq/powershell-devops@v0 - with: - required-version: 0.0.7 -``` - -Minimum version: - -```yml -steps: -- uses: smokedlinq/powershell-devops@v0 - with: - minimum-version: 0.0.7 -``` - -Maximum version: - -```yml -steps: -- uses: smokedlinq/powershell-devops@v0 - with: - maximum-version: 0.0.7 -``` - -## Commands - -### Set-EnvironmentVariable - -Sets the environment variable for the current process and optionally marks it as a secret. - -```powershell -set-env MY_VALUE 'Hello World!' -``` - -*Note: `set-env` is an alias for `Set-EnvironmentVariable`.* - -### Get-EnvironmentVariable - -Gets the environment variable for the current process and optionally throws an error if it is not defined. - -```powershell -get-env MY_ENV_VALUE -Require -``` - -*Note: `get-env` is an alias for `Get-EnvironmentVariable`.* - -### Add-Path - -Prepends the value to the PATH environment. - -```powershell -Add-Path $PSScriptRoot -``` - -### Enter-Group / Exit-Group - -Creates an expandable group in the log. Anything you print to the log between the `Enter-Group` and `Exit-Group` commands is nested inside an expandable entry in the log. - -```powershell -Enter-Group 'My group' -try { - # .. some other commands ... -} finally { - Exit-Group -} -``` - -### Utility functions - -These functions are helper functions that are used by the module but could also be useful within your script. - -#### Test-AdoPipeline - -Returns true if running in an Azure DevOps Pipeline, determined by the environment variable `TF_BUILD` having a value. - -```powershell -Test-AdoPipeline -``` - -#### Test-GitHubWorkflow - -Returns true if running in a GitHub Workflow, determined by the environment variable `GITHUB_ACTIONS` having a value. - -```powershell -Test-GitHubWorkflow -``` - -## License - -The scripts and documentation in this project are released under the [MIT License](LICENSE) - -## Contributions - -Contributions are welcome! +See [action.yml](/powershell-devops/install-module/action.yml) for more information. diff --git a/action.yml b/action.yml deleted file mode 100644 index db58e19..0000000 --- a/action.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Install powershell-devops Module -description: Installs the powershell-devops module from the PowerShell Gallery -author: smokedlinq -branding: - icon: play - color: green -inputs: - required-version: - description: 'Optional required version to install. If not provided, will install the latest version. Example: 0.0.7' - required: false - minimum-version: - description: 'Optional minimum version to install. If not provided, will install the latest version. Example: 0.0.7' - required: false - maximum-version: - description: 'Optional maximum version to install. If not provided, will install the latest version. Example: 0.0.7' - required: false -runs: - using: composite - steps: - - name: Install-Module powershell-devops - shell: pwsh - env: - # https://github.com/actions/runner/issues/665 - INPUT_REQUIRED_VERSION: ${{ inputs.required-version }} - INPUT_MINIMUM_VERSION: ${{ inputs.minimum-version }} - INPUT_MAXIMUM_VERSION: ${{ inputs.maximum-version }} - run: | - if ($env:INPUT_REQUIRED_VERSION) { - Install-Module powershell-devops -RequiredVersion $env:INPUT_REQUIRED_VERSION -Force - } else { - $InstallModuleParameters = @{} - - if ($env:INPUT_MINIMUM_VERSION) { - $InstallModuleParameters.MinimumVersion = $env:INPUT_MINIMUM_VERSION - } - - if ($env:INPUT_MAXIMUM_VERSION) { - $InstallModuleParameters.MaximumVersion = $env:INPUT_MAXIMUM_VERSION - } - - Install-Module powershell-devops -Force -AllowClobber @InstallModuleParameters - } \ No newline at end of file