Add support for clearing field values with new "clear" operation#181
Merged
Add support for clearing field values with new "clear" operation#181
Conversation
- Add clearField function using ClearProjectV2ItemFieldValueInput GraphQL mutation - Update getInputs to accept "clear" as valid operation - Update run function to handle clear operation - Add comprehensive tests for clear functionality - Update action.yml and README.md documentation - Maintain backwards compatibility with existing operations Co-authored-by: benbalter <282759+benbalter@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Feature request: clear field value support
Add support for clearing field values with new "clear" operation
Aug 15, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for clearing field values in GitHub Projects by introducing a new "clear" operation that uses the clearProjectV2ItemFieldValue GraphQL mutation.
- Added a new
clearField()function to execute field clearing operations - Enhanced input validation to accept "clear" as a valid operation type
- Updated the main workflow to handle clear operations with appropriate logging and output
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/update-project.ts | Implements the core clearField() function and integrates clear operation into input validation and main workflow |
| action.yml | Updates operation description to include "clear" option |
| test/main.test.ts | Adds comprehensive test coverage for clear operation input validation, function behavior, and end-to-end workflow |
| README.md | Updates documentation with clear operation usage examples and corrects parameter descriptions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 adds support for clearing field values in GitHub Projects using the new
clearoperation, which leverages GitHub'sclearProjectV2ItemFieldValueGraphQL mutation.Problem
Currently, there's no way to clear Date fields (or other field types) in GitHub Projects using this action. Users needed a way to remove values from fields, particularly Date fields, but the existing
updateoperation only allows setting values, not clearing them.Solution
Added a new
clearoperation that uses theClearProjectV2ItemFieldValueInputGraphQL mutation to clear field values.Key Changes:
clearField()function: Implements theclearProjectV2ItemFieldValueGraphQL mutationgetInputs()to accept"clear"as a valid operation alongside"read"and"update"run()function to handle clear operations with appropriate loggingaction.ymlandREADME.mdwith clear operation details and usage examplesUsage Example:
Backwards Compatibility
This change is fully backwards compatible. Existing workflows using
readandupdateoperations continue to work exactly as before. Theclearoperation is purely additive.Testing
Fixes #144.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.