Fix NUMBER field update issue by converting string values to numbers #178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue where NUMBER field types could not be updated because string values from GitHub Actions inputs were being passed directly to the GraphQL API, which expects numeric values.
Problem
When updating a NUMBER field with a value like
0, the GitHub Actions input system provides the value as a string"0". The existing code passed this string directly to the GraphQL mutation, but the API expects a numeric value for NUMBER fields, causing the update to fail.Solution
Added type conversion logic to properly handle NUMBER fields:
New
convertValueToFieldType()function - Converts string inputs to the appropriate type based on the field type:"0","42","3.14"to numeric valuesUpdated
updateField()function - Now uses converted values instead of raw string inputs for all non-single-select fieldsComprehensive test coverage - Added tests for various number formats including the specific case mentioned in the issue
Testing
The fix includes tests for:
All existing tests continue to pass, ensuring backward compatibility.
Fixes #171.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.