Move the handler logic out of the YAML script block into a standalone main.js loaded via require(GITHUB_ACTION_PATH). This improves readability and makes the JS easier to lint and unit-test directly.