Skip to content

Commit 15af118

Browse files
vaindclaude
andcommitted
refactor: Use PowerShell for input validation steps
Convert the validation steps from Bash to PowerShell for consistency with the rest of the workflow which uses PowerShell as its default shell. - Use PowerShell's -notmatch operator instead of Bash regex - Use Write-Output instead of echo - Maintain the same validation logic and error messages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 4526fc8 commit 15af118

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/updater.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,24 @@ jobs:
7676
runs-on: ubuntu-latest
7777
steps:
7878
- name: Validate dependency name
79+
shell: pwsh
7980
run: |
8081
# Validate that inputs.name contains only safe characters
81-
if [[ ! "${{ inputs.name }}" =~ ^[a-zA-Z0-9_\./@[:space:]-]+$ ]]; then
82-
echo "::error::Invalid dependency name: '${{ inputs.name }}'. Only alphanumeric characters, spaces, and _-./@ are allowed."
82+
if ('${{ inputs.name }}' -notmatch '^[a-zA-Z0-9_\./@\s-]+$') {
83+
Write-Output "::error::Invalid dependency name: '${{ inputs.name }}'. Only alphanumeric characters, spaces, and _-./@ are allowed."
8384
exit 1
84-
fi
85-
echo "✓ Dependency name '${{ inputs.name }}' is valid"
85+
}
86+
Write-Output "✓ Dependency name '${{ inputs.name }}' is valid"
8687
8788
- name: Validate dependency path
89+
shell: pwsh
8890
run: |
8991
# Validate that inputs.path contains only safe characters
90-
if [[ ! "${{ inputs.path }}" =~ ^[a-zA-Z0-9_\./-]+$ ]]; then
91-
echo "::error::Invalid dependency path: '${{ inputs.path }}'. Only alphanumeric characters and _-./ are allowed."
92+
if ('${{ inputs.path }}' -notmatch '^[a-zA-Z0-9_\./-]+$') {
93+
Write-Output "::error::Invalid dependency path: '${{ inputs.path }}'. Only alphanumeric characters and _-./ are allowed."
9294
exit 1
93-
fi
94-
echo "✓ Dependency path '${{ inputs.path }}' is valid"
95+
}
96+
Write-Output "✓ Dependency path '${{ inputs.path }}' is valid"
9597
9698
# What we need to accomplish:
9799
# * update to the latest tag

0 commit comments

Comments
 (0)