Skip to content

Commit d5d97e8

Browse files
🩹 [Patch]: Align default inputs and envvar naming (#71)
## Description This pull request includes updates to the documentation, configuration, and script files to improve functionality and readability, including adding new configuration options, updating the environment variable names, and modifying error handling in the main script. * `action.yml`: * Added new input parameters (`Debug`, `Verbose`, `Version`, `Prerelease`, `WorkingDirectory`) to the action configuration. * `scripts/main.ps1`: * Removed the `try` block and associated error handling to simplify the script. * Updated the script path format to use forward slashes for compatibility. * `README.md`: * Added new configuration options (`Debug`, `Verbose`, `Version`, `Prerelease`, `WorkingDirectory`) to the settings table. * Reformatted the note about label configuration to improve readability. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 28783c7 commit d5d97e8

File tree

3 files changed

+294
-267
lines changed

3 files changed

+294
-267
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ The following labels will inform the action what kind of release to create:
2727

2828
When a pull request is closed, the action will create a release based on the labels and clean up any previous prereleases that was created.
2929

30-
> Note: The labels can be configured using the `MajorLabels`, `MinorLabels` and `PatchLabels` parameters/settings in the configuration file to trigger on other labels.
30+
> [!NOTE]
31+
> The labels can be configured using the `MajorLabels`, `MinorLabels` and `PatchLabels` parameters/settings in the configuration file to trigger
32+
> on other labels.
3133
3234
## Usage
3335

@@ -48,6 +50,11 @@ The action can be configured using the following settings:
4850
| `PatchLabels` | A comma separated list of labels that trigger a patch release. | `patch, fix` | false |
4951
| `VersionPrefix` | The prefix to use for the version number. | `v` | false |
5052
| `WhatIf` | Control wether to simulate the action. If enabled, the action will not create any releases. Used for testing. | `false` | false |
53+
| `Debug` | Enable debug output. | `'false'` | false |
54+
| `Verbose` | Enable verbose output. | `'false'` | false |
55+
| `Version` | Specifies the exact version of the GitHub module to install. | | false |
56+
| `Prerelease` | Allow prerelease versions if available. | `'false'` | false |
57+
| `WorkingDirectory` | The working directory where the script runs. | `${{ github.workspace }}` | false |
5158

5259
### Configuration file
5360

action.yml

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,51 @@ inputs:
5858
description: If specified, the action will only log the changes it would make, but will not actually create or delete any releases or tags.
5959
required: false
6060
default: 'false'
61+
Debug:
62+
description: Enable debug output.
63+
required: false
64+
default: 'false'
65+
Verbose:
66+
description: Enable verbose output.
67+
required: false
68+
default: 'false'
69+
Version:
70+
description: Specifies the version of the GitHub module to be installed. The value must be an exact version.
71+
required: false
72+
Prerelease:
73+
description: Allow prerelease versions if available.
74+
required: false
75+
default: 'false'
76+
WorkingDirectory:
77+
description: The working directory where the script will run from.
78+
required: false
79+
default: ${{ github.workspace }}
6180

6281
runs:
6382
using: composite
6483
steps:
6584
- name: Auto-Release
6685
uses: PSModule/GitHub-Script@v1
6786
env:
68-
GITHUB_ACTION_INPUT_AutoCleanup: ${{ inputs.AutoCleanup }}
69-
GITHUB_ACTION_INPUT_AutoPatching: ${{ inputs.AutoPatching }}
70-
GITHUB_ACTION_INPUT_ConfigurationFile: ${{ inputs.ConfigurationFile }}
71-
GITHUB_ACTION_INPUT_CreateMajorTag: ${{ inputs.CreateMajorTag }}
72-
GITHUB_ACTION_INPUT_CreateMinorTag: ${{ inputs.CreateMinorTag }}
73-
GITHUB_ACTION_INPUT_DatePrereleaseFormat: ${{ inputs.DatePrereleaseFormat }}
74-
GITHUB_ACTION_INPUT_IgnoreLabels: ${{ inputs.IgnoreLabels }}
75-
GITHUB_ACTION_INPUT_IncrementalPrerelease: ${{ inputs.IncrementalPrerelease }}
76-
GITHUB_ACTION_INPUT_MajorLabels: ${{ inputs.MajorLabels }}
77-
GITHUB_ACTION_INPUT_MinorLabels: ${{ inputs.MinorLabels }}
78-
GITHUB_ACTION_INPUT_PatchLabels: ${{ inputs.PatchLabels }}
79-
GITHUB_ACTION_INPUT_VersionPrefix: ${{ inputs.VersionPrefix }}
80-
GITHUB_ACTION_INPUT_WhatIf: ${{ inputs.WhatIf }}
87+
PSMODULE_AUTO_RELEASE_INPUT_AutoCleanup: ${{ inputs.AutoCleanup }}
88+
PSMODULE_AUTO_RELEASE_INPUT_AutoPatching: ${{ inputs.AutoPatching }}
89+
PSMODULE_AUTO_RELEASE_INPUT_ConfigurationFile: ${{ inputs.ConfigurationFile }}
90+
PSMODULE_AUTO_RELEASE_INPUT_CreateMajorTag: ${{ inputs.CreateMajorTag }}
91+
PSMODULE_AUTO_RELEASE_INPUT_CreateMinorTag: ${{ inputs.CreateMinorTag }}
92+
PSMODULE_AUTO_RELEASE_INPUT_DatePrereleaseFormat: ${{ inputs.DatePrereleaseFormat }}
93+
PSMODULE_AUTO_RELEASE_INPUT_IgnoreLabels: ${{ inputs.IgnoreLabels }}
94+
PSMODULE_AUTO_RELEASE_INPUT_IncrementalPrerelease: ${{ inputs.IncrementalPrerelease }}
95+
PSMODULE_AUTO_RELEASE_INPUT_MajorLabels: ${{ inputs.MajorLabels }}
96+
PSMODULE_AUTO_RELEASE_INPUT_MinorLabels: ${{ inputs.MinorLabels }}
97+
PSMODULE_AUTO_RELEASE_INPUT_PatchLabels: ${{ inputs.PatchLabels }}
98+
PSMODULE_AUTO_RELEASE_INPUT_VersionPrefix: ${{ inputs.VersionPrefix }}
99+
PSMODULE_AUTO_RELEASE_INPUT_WhatIf: ${{ inputs.WhatIf }}
81100
with:
101+
Debug: ${{ inputs.Debug }}
102+
Prerelease: ${{ inputs.Prerelease }}
103+
Verbose: ${{ inputs.Verbose }}
104+
Version: ${{ inputs.Version }}
105+
WorkingDirectory: ${{ inputs.WorkingDirectory }}
82106
Script: |
83107
# Auto-Release
84-
${{ github.action_path }}\scripts\main.ps1
108+
${{ github.action_path }}/scripts/main.ps1

0 commit comments

Comments
 (0)