Fix edge case where substring could leave trailing seperators

This commit is contained in:
Elliot Iddon 2022-09-03 17:50:47 +01:00
parent d316655d62
commit aa8fa3ff4e

View File

@ -25,13 +25,15 @@ try {
// Remove invalid characters
result = result.replaceAll(/[^a-zA-Z0-9\._-]/g, '')
// Remove start and end periods and dashes
// Remove starting end periods and dashes
result = result.replace(/^[-\.]+/, '')
result = result.replace(/[-\.]+$/, '')
// Maximum of 128 characters
result = result.substr(0, 128)
// Remove ending periods and dashes
result = result.replace(/[-\.]+$/, '')
core.setOutput('tag-name', result);
}
} catch (error) {