| 133 | value = replace_all(value, "${workflow_dir}", context.workflow_dir.string()); |
| 134 | for (const auto & [key, item] : context.values) { |
| 135 | value = replace_all(value, "${" + key + "}", item); |
| 136 | } |
| 137 | return value; |
| 138 | } |
| 139 | |
| 140 | std::string safe_workflow_id(std::string value) { |
| 141 | if (value.empty()) { |
| 142 | throw std::runtime_error("workflow batch item id must not be empty"); |
| 143 | } |
| 144 | for (char & ch : value) { |
| 145 | const unsigned char uch = static_cast<unsigned char>(ch); |
| 146 | if (std::isalnum(uch) == 0 && ch != '-' && ch != '_') { |
| 147 | ch = '_'; |
| 148 | } |
| 149 | } |
no test coverage detected