Skip to content

Commit

Permalink
20220720A
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoalh committed Jul 20, 2022
1 parent edf0938 commit 0059b68
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 105 deletions.
24 changes: 12 additions & 12 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

## 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.

## Our Standards

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

Expand Down Expand Up @@ -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).

Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | ❌{🐛🧓} |
Expand Down
41 changes: 26 additions & 15 deletions .github/workflows/announce-new-release-discord.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:** <https://www.powershellgallery.com/packages/hugoalh.GitHubActionsToolkit>
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"
18 changes: 0 additions & 18 deletions .github/workflows/announce-new-release-ifttt.yml

This file was deleted.

42 changes: 25 additions & 17 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)) |
|:-:|:-:|:-:|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'hugoalh.GitHubActionsToolkit.psm1'

# Version number of this module.
ModuleVersion = '0.5.0'
ModuleVersion = '0.5.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
4 changes: 2 additions & 2 deletions hugoalh.GitHubActionsToolkit/module/environment-variable.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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 $_
}
Expand Down Expand Up @@ -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
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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",
Expand Down
70 changes: 35 additions & 35 deletions hugoalh.GitHubActionsToolkit/module/utility.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0059b68

Please sign in to comment.