docs: fix inaccuracies and add missing required flags in action.yml by kranthipoturaju · Pull Request #721 · actions/github-script
Summary
Corrects inaccuracies and fills documentation gaps in action.yml to accurately reflect the current implementation in src/main.ts and src/retry-options.ts. No behavior or code changes are included.
Changes
resultoutput description fixed: Previously stated the result is always "stringified withJSON.stringify", which is only true forresult-encoding: json. Whenresult-encoding: string, the output usesString(). Description now covers both paths.result-encodingdescription improved: Removed the redundant(default "json")phrase (already declared in thedefault:field) and replaced with the concrete JS functions used for each mode.user-agentdescription updated: TheACTIONS_ORCHESTRATION_IDenvironment variable is read at runtime inmain.tsand silently appended to the user-agent string. This behavior was entirely undocumented inaction.yml.required: falseadded to all implicitly optional inputs:debug,user-agent,previews,result-encoding,retries, andretry-exempt-status-codeswere all optional but lacked the explicit flag.previewsin particular had neither adefault:norrequired: false, making its optionality ambiguous to tooling and readers.
Motivation
action.yml is the primary machine-readable and human-readable contract for this action. Inaccurate descriptions mislead users and tooling (IDE completions, actionlint, documentation generators). The result output description was factually wrong for the string encoding path, and the undocumented ACTIONS_ORCHESTRATION_ID behavior was invisible to users trying to understand or debug user-agent strings in audit logs.
Impact
- Users: No behavioral change. All input names, defaults, and output names are unchanged—full backward compatibility is preserved.
- Tooling:
actionlintand schema validators now see explicitrequired: falseon all optional inputs, reducing false-positive warnings. - Documentation generators: Output description now accurately describes both encoding modes.
Testing
action.yml is a metadata file with no executable logic. The change was validated by:
- Confirming each modified field against the corresponding code path in
src/main.ts(result-encodingswitch,getUserAgentWithOrchestrationId,core.getInputcalls). - Verifying no input names, defaults, or output names were altered.
- Running
git diffto confirm the diff is strictly additive to descriptions andrequired: falseflags with no structural changes.