refactor: structure processing in action commit

prep work for retry processing
fix previously introduced memleak with template strings