Skip to content

Commit e099f88

Browse files
🚀 [Feature]: Add 'Name' input (#47)
## Description This pull request introduces a new input parameter, `Name`, to the GitHub PowerShell-based action, allowing customization of the action's name. ### Integration of `Name` parameter: Workflow Configuration: * [`.github/workflows/TestWorkflow.yml`](diffhunk://#diff-242a265d6d6bfff6094c9285345022d0e6d7ddde58504dfc80249fafbd89ba2cR144): Added `Name: Action-Test` to the action inputs. Documentation: * [`README.md`](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R13): Documented the new `Name` parameter in the table of action inputs. Action Definition: * [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R9-R12): Added the `Name` input parameter with a default value of `GitHub-Script`. * [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R71): Included `PSMODULE_GITHUB_SCRIPT_INPUT_Name` in the environment variables passed to the script. Script Updates: * [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6L78-R83): Updated the script execution section to use the `Name` parameter. * [`scripts/info.ps1`](diffhunk://#diff-82c586f67d16e32953b47a962c269d0a484f8aa660d71ad354e91fd2d4334cd9L13-R13): Replaced the hardcoded `fenceTitle` with the `Name` parameter. * [`scripts/init.ps1`](diffhunk://#diff-f47ceebe9ade2bb55cede031de8267e9c87b09336a93fcd557c02c1f488554b6L13-R13): Replaced the hardcoded `fenceTitle` with the `Name` parameter. * [`scripts/outputs.ps1`](diffhunk://#diff-ee715ca93229232e95883bf00629fd14e3bf174cdc17b723c4cc5d70e6a60a58L12-R12): Replaced the hardcoded `fenceTitle` with the `Name` parameter. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas
1 parent ab5198a commit e099f88

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

.github/workflows/TestWorkflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ jobs:
141141
uses: ./
142142
id: test
143143
with:
144+
Name: Action-Test
144145
Debug: true
145146
Verbose: true
146147
Prerelease: ${{ inputs.Prerelease }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ To get started with your own GitHub PowerShell based action, [create a new repos
1010

1111
| Name | Description | Required | Default |
1212
|--------------------|---------------------------------------------------------------------------|----------|-----------------------|
13+
| `Name` | The name of the action. | false | `GitHub-Script` |
1314
| `Script` | The script to run. Can be inline, multi-line, or a path to a script file. | false | |
1415
| `Token` | Log in using an Installation Access Token (IAT). | false | `${{ github.token }}` |
1516
| `ClientID` | Log in using a GitHub App, with the App's Client ID and Private Key. | false | |

action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ branding:
66
color: white
77

88
inputs:
9+
Name:
10+
description: The name of the action.
11+
required: false
12+
default: 'GitHub-Script'
913
Script:
1014
description: The script to run. Can be inline, multi-line or a path to a script file.
1115
required: false
@@ -64,6 +68,7 @@ runs:
6468
id: RunGitHubScript
6569
working-directory: ${{ inputs.WorkingDirectory }}
6670
env:
71+
PSMODULE_GITHUB_SCRIPT_INPUT_Name: ${{ inputs.Name }}
6772
PSMODULE_GITHUB_SCRIPT_INPUT_Token: ${{ inputs.Token }}
6873
PSMODULE_GITHUB_SCRIPT_INPUT_ClientID: ${{ inputs.ClientID }}
6974
PSMODULE_GITHUB_SCRIPT_INPUT_PrivateKey: ${{ inputs.PrivateKey }}
@@ -75,7 +80,7 @@ runs:
7580
PSMODULE_GITHUB_SCRIPT_INPUT_ShowOutput: ${{ inputs.ShowOutput }}
7681
PSMODULE_GITHUB_SCRIPT_INPUT_Prerelease: ${{ inputs.Prerelease }}
7782
run: |
78-
# GitHub-Script
83+
# ${{ inputs.Name }}
7984
try {
8085
${{ github.action_path }}/scripts/init.ps1
8186
${{ github.action_path }}/scripts/info.ps1

scripts/info.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ begin {
1010

1111
process {
1212
try {
13-
$fenceTitle = 'GitHub-Script'
13+
$fenceTitle = $env:PSMODULE_GITHUB_SCRIPT_INPUT_Name
1414

1515
Write-Debug "[$scriptName] - ShowInfo: $env:PSMODULE_GITHUB_SCRIPT_INPUT_ShowInfo"
1616
if ($env:PSMODULE_GITHUB_SCRIPT_INPUT_ShowInfo -ne 'true') {

scripts/init.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ begin {
1010
process {
1111
try {
1212
$env:PSMODULE_GITHUB_SCRIPT = $true
13-
$fenceTitle = 'GitHub-Script'
13+
$fenceTitle = $env:PSMODULE_GITHUB_SCRIPT_INPUT_Name
1414
$showInit = $env:PSMODULE_GITHUB_SCRIPT_INPUT_ShowInit -eq 'true'
1515

1616
Write-Debug "[$scriptName] - ShowInit: $env:PSMODULE_GITHUB_SCRIPT_INPUT_ShowInit"

scripts/outputs.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $scriptName = $MyInvocation.MyCommand.Name
99
Write-Debug "[$scriptName] - Start"
1010

1111
try {
12-
$fenceTitle = 'GitHub-Script'
12+
$fenceTitle = $env:PSMODULE_GITHUB_SCRIPT_INPUT_Name
1313

1414
Write-Debug "[$scriptName] - ShowOutput: $env:PSMODULE_GITHUB_SCRIPT_INPUT_ShowOutput"
1515
if ($env:PSMODULE_GITHUB_SCRIPT_INPUT_ShowOutput -ne 'true') {

0 commit comments

Comments
 (0)