diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index f9a87de..548eaf8 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -2,7 +2,7 @@ ## Our Pledge -We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, colo(u)r, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. @@ -10,19 +10,19 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div Examples of behavior that contributes to a positive environment for our community include: -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall community +- Demonstrating empathy and kindness toward other people. +- Being respectful of differing opinions, viewpoints, and experiences. +- Giving and gracefully accepting constructive feedback. +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience. +- Focusing on what is best not just for us as individuals, but for the overall community. Examples of unacceptable behavior include: -- The use of sexualized language or imagery, and sexual attention or advances of any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a professional setting +- The use of sexualized language or imagery, and sexual attention or advances of any kind. +- Trolling, insulting or derogatory comments, and personal or political attacks. +- Public or private harassment. +- Publishing others' private information, such as a physical or email address, without their explicit permission. +- Other conduct which could reasonably be considered inappropriate in a professional setting. ## Enforcement Responsibilities @@ -65,7 +65,7 @@ Community leaders will follow these Community Impact Guidelines in determining t ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index a3dcedb..5d7309e 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -18,6 +18,7 @@ body: description: "What versions are affected? Versions must be listed as supported in the Security Policy (/.github/SECURITY.md)." multiple: true options: + - "v0.5.1" - "v0.5.0" - "v0.4.1" - "v0.4.0" diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 4c4005b..ff13d44 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -13,7 +13,9 @@ | **Tag / Version** | **Target** | **Support** | |:-:|:-:|:-:| -| v0.X.X | PowerShell v7.2.0 | L | +| v0.X.X | PowerShell v7.2.0 | ✔ | +| v0.4.X | PowerShell v7.2.0 | 👎{🧓} | +| v0.3.X | PowerShell v7.2.0 | 👎{🧓} | | v0.3.0 \~ v0.3.2 | PowerShell v7.2.0 | ❌{🐛🧓} | | v0.2.X | PowerShell v7.2.0 | ❌{🧓} | | < v0.2.X | PowerShell v7.2.0 | ❌{🐛🧓} | diff --git a/.github/workflows/announce-new-release-discord.yml b/.github/workflows/announce-new-release-discord.yml index d7e1cf0..3f0c21a 100644 --- a/.github/workflows/announce-new-release-discord.yml +++ b/.github/workflows/announce-new-release-discord.yml @@ -8,25 +8,36 @@ jobs: name: "Announce New Release - Discord" runs-on: "ubuntu-latest" steps: - - uses: "hugoalh/send-discord-webhook-ghaction@v4.2.0" + - uses: "hugoalh/send-discord-webhook-ghaction@v4.2.2" with: - key: "${{secrets.DISCORDWEBHOOK_HUGOALHSTUDIO_STUDIOANNOUNCEMENT_PROJECTNEWRELEASEANNOUNCER}}" + key: "${{secrets.DISCORD_HXHS_PROJECTNEWRELEASEANNOUNCER_WEBHOOK}}" payload: | - content: | - **__GitHub Actions Toolkit (PowerShell)__** - - Version ${{github.event.release.name}} (${{github.event.release.tag_name}}) is released and available on: - - - **GitHub Repository Release (& Changelog):** <${{github.event.release.html_url}}> - - **PowerShell Gallery:** embeds: - - description: | - **__GitHub Actions Toolkit (PowerShell)__** - - ${{github.event.repository.description}} + - title: "GitHub Actions Toolkit (PowerShell)" + description: | + > ${{github.event.repository.description}} - - **GitHub:** ${{github.event.repository.html_url}} + Version ${{github.event.release.name}} (${{github.event.release.tag_name}}) just released! color: "44,85,145" thumbnail: - url: "https://i.imgur.com/PRyLxK8.png" + url: "https://i.imgur.com/OhKCMwk.png" + fields: + - name: "GitHub: ${{github.event.repository.full_name}}" + value: "${{github.event.repository.html_url}}" + inline: true + - name: "GitHub Repository Release & Changelog" + value: "${{github.event.release.html_url}}" + inline: true + - name: "PowerShell Gallery" + value: "https://www.powershellgallery.com/packages/hugoalh.GitHubActionsToolkit" + inline: true + - name: "." + value: "." + inline: false + - name: "Author" + value: "${{github.event.release.author.login}}" + inline: true + - name: "Publish Time" + value: "${{github.event.release.published_at}}" + inline: true wait: "true" diff --git a/.github/workflows/announce-new-release-ifttt.yml b/.github/workflows/announce-new-release-ifttt.yml deleted file mode 100644 index 61428a1..0000000 --- a/.github/workflows/announce-new-release-ifttt.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: "Announce New Release - IFTTT" -on: - release: - types: - - "published" -jobs: - announce-new-release-ifttt: - name: "Announce New Release - IFTTT" - runs-on: "ubuntu-latest" - steps: - - uses: "hugoalh/trigger-ifttt-webhook-applet-ghaction@v4.1.1" - with: - eventname: "githubaction_twitter" - key: "${{secrets.IFTTTWEBHOOK_HUGOALH_KEY}}" - payload: | - { - "value1": "GitHub Actions Toolkit (PowerShell) version ${{github.event.release.name}} (${{github.event.release.tag_name}}) is released and available on GitHub!\n${{github.event.release.html_url}}" - } diff --git a/LICENSE.md b/LICENSE.md index 25beb46..f266f77 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,27 +1,35 @@ # MIT License -© 2021\~2022 hugoalh Studio +Copyright © 2021\~2022 hugoalh Studio Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- -*This is a short and simple list that mostly concluded this license about the permissions 🟢, conditions 🔵, and limitations 🔴, this license content section shall prevail.* - -- Commercial Use 🟢 -- Distribution 🟢 -- Modification 🟢 -- Patent Use -- Private Use 🟢 -- Disclose Source -- License & Copyright Notice 🔵 -- Network Use Is Distribution -- Same License -- State Changes -- Liability 🔴 -- Trademark Use -- Warranty 🔴 +## TLDR + +This is a short and simple list that mostly concluded this license about the permissions, conditions, and limitations, this license content section shall prevail. + +### Permissions + +- **Commercial Use:** The licensed material and derivatives may be used for commercial purposes. +- **Distribution:** The licensed material may be distributed. +- **Modification:** The licensed material may be modified. +- **Private Use:** The licensed material may be used and modified in private. + +### Conditions + +- **License & Copyright Notice:** A copy of the license and copyright notice must be included with the licensed material. + +### Limitations + +- **Liability:** This license includes a limitation of liability. +- **Warranty:** This license explicitly states that it does not provide any warranty. + +## Attribution + +This license is adopted from [Choose A License](https://choosealicense.com/), available at [here](https://choosealicense.com/licenses/mit). diff --git a/README.md b/README.md index ed72fa9..9ce68ac 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![GitHub Forks](https://img.shields.io/github/forks/hugoalh-studio/ghactions-toolkit-powershell?label=Forks&logo=github&logoColor=ffffff&style=flat-square)](https://github.com/hugoalh-studio/ghactions-toolkit-powershell/network/members) ![GitHub Languages](https://img.shields.io/github/languages/count/hugoalh-studio/ghactions-toolkit-powershell?label=Languages&logo=github&logoColor=ffffff&style=flat-square) [![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/hugoalh-studio/ghactions-toolkit-powershell?label=Grade&logo=codefactor&logoColor=ffffff&style=flat-square)](https://www.codefactor.io/repository/github/hugoalh-studio/ghactions-toolkit-powershell) -[![License](https://img.shields.io/static/v1?label=License&message=MIT&color=brightgreen&style=flat-square)](./LICENSE.md) +[![License](https://img.shields.io/static/v1?label=License&message=MIT&style=flat-square)](./LICENSE.md) | **Release** | **Latest** (![GitHub Latest Release Date](https://img.shields.io/github/release-date/hugoalh-studio/ghactions-toolkit-powershell?label=%20&style=flat-square)) | **Pre** (![GitHub Latest Pre-Release Date](https://img.shields.io/github/release-date-pre/hugoalh-studio/ghactions-toolkit-powershell?label=%20&style=flat-square)) | |:-:|:-:|:-:| diff --git a/hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1 b/hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1 index 87acd45..5ba24ed 100644 --- a/hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1 +++ b/hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1 @@ -3,7 +3,7 @@ RootModule = 'hugoalh.GitHubActionsToolkit.psm1' # Version number of this module. - ModuleVersion = '0.5.0' + ModuleVersion = '0.5.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/hugoalh.GitHubActionsToolkit/module/environment-variable.psm1 b/hugoalh.GitHubActionsToolkit/module/environment-variable.psm1 index 26d62b5..0a41468 100644 --- a/hugoalh.GitHubActionsToolkit/module/environment-variable.psm1 +++ b/hugoalh.GitHubActionsToolkit/module/environment-variable.psm1 @@ -48,7 +48,7 @@ Function Add-PATH { [System.Environment]::SetEnvironmentVariable('PATH', ((([System.Environment]::GetEnvironmentVariable('PATH') -isplit [System.IO.Path]::PathSeparator) + $Result) -join [System.IO.Path]::PathSeparator)) | Out-Null } 'Subsequent' { - If ($Null -ieq $Env:GITHUB_PATH) { + If ([String]::IsNullOrWhiteSpace($Env:GITHUB_PATH)) { $Result | ForEach-Object -Process { Write-GitHubActionsCommand -Command 'add-path' -Value $_ } @@ -128,7 +128,7 @@ Function Set-EnvironmentVariable { } } 'Subsequent' { - If ($Null -ieq $Env:GITHUB_ENV) { + If ([String]::IsNullOrWhiteSpace($Env:GITHUB_ENV)) { $Result.GetEnumerator() | ForEach-Object -Process { Write-GitHubActionsCommand -Command 'set-env' -Parameter @{ 'name' = $_.Name } -Value $_.Value } diff --git a/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package-lock.json b/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package-lock.json index b5ef2f1..9a6a844 100644 --- a/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package-lock.json +++ b/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package-lock.json @@ -1,12 +1,12 @@ { "name": "@hugoalh/ghactions-toolkit-powershell-nodejs-wrapper", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@hugoalh/ghactions-toolkit-powershell-nodejs-wrapper", - "version": "0.5.0", + "version": "0.5.1", "license": "MIT", "dependencies": { "@actions/artifact": "^1.1.0", diff --git a/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package.json b/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package.json index 6b41fe6..8151758 100644 --- a/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package.json +++ b/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package.json @@ -1,6 +1,6 @@ { "name": "@hugoalh/ghactions-toolkit-powershell-nodejs-wrapper", - "version": "0.5.0", + "version": "0.5.1", "description": "A PowerShell module to provide a better and easier way for GitHub Actions to communicate with the runner machine, and the toolkit for developing GitHub Actions in PowerShell.", "keywords": [ "gh-actions", diff --git a/hugoalh.GitHubActionsToolkit/module/utility.psm1 b/hugoalh.GitHubActionsToolkit/module/utility.psm1 index 4cd4f11..9113f5e 100644 --- a/hugoalh.GitHubActionsToolkit/module/utility.psm1 +++ b/hugoalh.GitHubActionsToolkit/module/utility.psm1 @@ -144,44 +144,44 @@ Function Test-Environment { ) If ( $Env:CI -ine 'true' -or - $Null -ieq $Env:GITHUB_ACTION -or - $Null -ieq $Env:GITHUB_ACTION_REPOSITORY -or - $Null -ieq $Env:GITHUB_ACTIONS -or - $Null -ieq $Env:GITHUB_ACTOR -or - $Null -ieq $Env:GITHUB_API_URL -or - $Null -ieq $Env:GITHUB_ENV -or - $Null -ieq $Env:GITHUB_EVENT_NAME -or - $Null -ieq $Env:GITHUB_EVENT_PATH -or - $Null -ieq $Env:GITHUB_GRAPHQL_URL -or - $Null -ieq $Env:GITHUB_JOB -or - $Null -ieq $Env:GITHUB_PATH -or - $Null -ieq $Env:GITHUB_REF_NAME -or - $Null -ieq $Env:GITHUB_REF_PROTECTED -or - $Null -ieq $Env:GITHUB_REF_TYPE -or - $Null -ieq $Env:GITHUB_REPOSITORY -or - $Null -ieq $Env:GITHUB_REPOSITORY_OWNER -or - $Null -ieq $Env:GITHUB_RUN_ATTEMPT -or - $Null -ieq $Env:GITHUB_RUN_ID -or - $Null -ieq $Env:GITHUB_RUN_NUMBER -or - $Null -ieq $Env:GITHUB_SERVER_URL -or - $Null -ieq $Env:GITHUB_SHA -or - $Null -ieq $Env:GITHUB_WORKFLOW -or - $Null -ieq $Env:GITHUB_WORKSPACE -or - $Null -ieq $Env:RUNNER_ARCH -or - $Null -ieq $Env:RUNNER_NAME -or - $Null -ieq $Env:RUNNER_OS -or - $Null -ieq $Env:RUNNER_TEMP -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_ACTION) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_ACTION_REPOSITORY) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_ACTIONS) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_ACTOR) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_API_URL) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_ENV) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_EVENT_NAME) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_EVENT_PATH) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_GRAPHQL_URL) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_JOB) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_PATH) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_REF_NAME) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_REF_PROTECTED) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_REF_TYPE) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_REPOSITORY) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_REPOSITORY_OWNER) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_RUN_ATTEMPT) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_RUN_ID) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_RUN_NUMBER) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_SERVER_URL) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_SHA) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_WORKFLOW) -or + [String]::IsNullOrWhiteSpace($Env:GITHUB_WORKSPACE) -or + [String]::IsNullOrWhiteSpace($Env:RUNNER_ARCH) -or + [String]::IsNullOrWhiteSpace($Env:RUNNER_NAME) -or + [String]::IsNullOrWhiteSpace($Env:RUNNER_OS) -or + [String]::IsNullOrWhiteSpace($Env:RUNNER_TEMP) -or (( $Artifact.IsPresent -or $Cache.IsPresent - ) -and $Null -ieq $Env:ACTIONS_RUNTIME_TOKEN) -or - ($Artifact.IsPresent -and $Null -ieq $Env:ACTIONS_RUNTIME_URL) -or - ($Artifact.IsPresent -and $Null -ieq $Env:GITHUB_RETENTION_DAYS) -or - ($Cache.IsPresent -and $Null -ieq $Env:ACTIONS_CACHE_URL) -or - ($OpenIdConnect.IsPresent -and $Null -ieq $Env:ACTIONS_ID_TOKEN_REQUEST_TOKEN) -or - ($OpenIdConnect.IsPresent -and $Null -ieq $Env:ACTIONS_ID_TOKEN_REQUEST_URL) -or - ($StepSummary.IsPresent -and $Null -ieq $Env:GITHUB_STEP_SUMMARY) -or - ($ToolCache.IsPresent -and $Null -ieq $Env:RUNNER_TOOL_CACHE) + ) -and [String]::IsNullOrWhiteSpace($Env:ACTIONS_RUNTIME_TOKEN)) -or + ($Artifact.IsPresent -and [String]::IsNullOrWhiteSpace($Env:ACTIONS_RUNTIME_URL)) -or + ($Artifact.IsPresent -and [String]::IsNullOrWhiteSpace($Env:GITHUB_RETENTION_DAYS)) -or + ($Cache.IsPresent -and [String]::IsNullOrWhiteSpace($Env:ACTIONS_CACHE_URL)) -or + ($OpenIdConnect.IsPresent -and [String]::IsNullOrWhiteSpace($Env:ACTIONS_ID_TOKEN_REQUEST_TOKEN)) -or + ($OpenIdConnect.IsPresent -and [String]::IsNullOrWhiteSpace($Env:ACTIONS_ID_TOKEN_REQUEST_URL)) -or + ($StepSummary.IsPresent -and [String]::IsNullOrWhiteSpace($Env:GITHUB_STEP_SUMMARY)) -or + ($ToolCache.IsPresent -and [String]::IsNullOrWhiteSpace($Env:RUNNER_TOOL_CACHE)) ) { If ($Mandatory.IsPresent) { Write-GitHubActionsFail -Message $MandatoryMessage