Skip to content

release-doc-sync bad-argument errors exit 1, which the action treats as success #152

Backlog

Description

@TMHSDigital

Summary

The documented contract is 0 = no change, 1 = changed, 2 = tool error. _validate_args raises SystemExit("::error::..."), and a SystemExit with a string exits with status 1, which the composite action treats as "files changed". The drift checker has the same pattern for a malformed STANDARDS_VERSION.

Where

  • scripts/release_doc_sync/sync.py:417-433 (_validate_args)
  • scripts/release_doc_sync/sync.py:468-481 (only OSError is caught)
  • .github/actions/release-doc-sync/action.yml:149-153
  • scripts/drift_check/cli.py:102 (_read_meta_version), :369-371

Details

if [ "$RC" -ne 0 ] && [ "$RC" -ne 1 ]; then
  echo "::error::release-doc-sync failed with exit code $RC"
  exit "$RC"
fi

main also catches only OSError, so a UnicodeDecodeError on a non-UTF-8 doc is an uncaught traceback (exit 1). In drift_check, raise SystemExit(f"meta-repo STANDARDS_VERSION is not a valid semver: ...") exits 1, which the CLI defines as "drift found", not "tool error".

Impact

A v-prefixed or empty version, a repository without /, a wrong caller-path, or an undecodable CHANGELOG produces a green "Sync release docs" step with no edits and empty outputs; the release is then tagged with stale CHANGELOG/CLAUDE.md/ROADMAP. A broken STANDARDS_VERSION makes every consumer report drift instead of a tool error.

Steps to reproduce

  1. python scripts/release_doc_sync/sync.py --repo-path <empty dir> --plugin-version v1.2.3 --previous-version 1.2.2 --repository a/b
  2. The ::error:: line is printed and the exit code is 1.

Suggested fix

Print the message to stderr and raise SystemExit(2) in _validate_args; catch UnicodeDecodeError/ValueError alongside OSError and return 2; validate --date as YYYY-MM-DD. Do the same in drift_check.cli._read_meta_version.

Acceptance criteria

  • Each _validate_args branch exits 2 (test per branch)
  • A non-UTF-8 doc exits 2
  • Malformed STANDARDS_VERSION exits 2 from drift_check

Getting started

  • Relevant files: .github/actions/release-doc-sync/action.yml, scripts/drift_check/cli.py, scripts/release_doc_sync/sync.py
  • How to run tests: pip install -r requirements-test.txt && python -m pytest
  • After any registry or standards change: python scripts/sync_from_registry.py
  • Conventions: see CONTRIBUTING.md and standards/writing-style.md

Filed by repo-audit/full-audit at 2c7a7fe. Severity: medium. Effort: S. audit-key: bug|scripts/release_doc_sync/sync.py|_validate_args

Activity

  1. added
    bug
    good first issue
    severity: medium
    on Nov 30, 2026
  2. abhicodes-007 commented on Nov 30, 2026

    @abhicodes-007

    Fix ready in PR #199: #199

    The regression test fails on the base branch and passes with the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions