Add support for clearing field values with new "clear" operation #181
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.