Skip to content

Commit 15e4b10

Browse files
vaindclaude
andauthored
fix: Handle boolean inputs correctly and validate supported values (#127)
* fix: Handle boolean inputs correctly and validate supported values - Fix changelog-entry boolean evaluation to properly check 'true' vs 'false' strings - Add input validation for changelog-entry to only allow 'true' or 'false' - Add input validation for pr-strategy to only allow 'create' or 'update' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * docs: Add changelog entry for boolean input fix 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent c6471d1 commit 15e4b10

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Updater - Fix boolean input handling for `changelog-entry` parameter and add input validation ([#127](https://github.com/getsentry/github-workflows/pull/127))
8+
39
## 3.0.0
410

511
### Breaking Changes

updater/action.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ runs:
8282
}
8383
Write-Output "✓ Dependency path '${{ inputs.path }}' is valid"
8484
85+
- name: Validate changelog-entry
86+
shell: pwsh
87+
run: |
88+
# Validate that inputs.changelog-entry is either 'true' or 'false'
89+
if ('${{ inputs.changelog-entry }}' -notin @('true', 'false')) {
90+
Write-Output "::error::Invalid changelog-entry value: '${{ inputs.changelog-entry }}'. Only 'true' or 'false' are allowed."
91+
exit 1
92+
}
93+
Write-Output "✓ Changelog-entry value '${{ inputs.changelog-entry }}' is valid"
94+
95+
- name: Validate pr-strategy
96+
shell: pwsh
97+
run: |
98+
# Validate that inputs.pr-strategy is either 'create' or 'update'
99+
if ('${{ inputs.pr-strategy }}' -notin @('create', 'update')) {
100+
Write-Output "::error::Invalid pr-strategy value: '${{ inputs.pr-strategy }}'. Only 'create' or 'update' are allowed."
101+
exit 1
102+
}
103+
Write-Output "✓ PR strategy value '${{ inputs.pr-strategy }}' is valid"
104+
85105
# What we need to accomplish:
86106
# * update to the latest tag
87107
# * create a PR
@@ -254,7 +274,7 @@ runs:
254274
run: ${{ github.action_path }}/scripts/update-dependency.ps1 -Path $env:DEPENDENCY_PATH -Tag '${{ steps.target.outputs.latestTag }}'
255275

256276
- name: Update Changelog
257-
if: ${{ inputs.changelog-entry && ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.root.outputs.changed == 'false') }}
277+
if: ${{ inputs.changelog-entry == 'true' && ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.root.outputs.changed == 'false') }}
258278
shell: pwsh
259279
working-directory: caller-repo
260280
env:

0 commit comments

Comments
 (0)