【发布时间】:2020-12-05 14:46:33
【问题描述】:
我想用 v 作为前缀和产品类型作为后缀来标记我的版本。 例如。初始版本 v1.0.0-alpha01-internal 或 v1.0.0-alpha01-external
现在我正在运行一个 GitHub 操作工作流来发布一个版本。
# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
# So if we split on '/' and take the 3rd value, we can get the release name.
run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
使用上面的代码 sn-p,我得到了我的新版本 v1.0.0-alpha01-internal 或 v1.0.0-alpha01-external 现在我没有希望我的版本与 TAG 相同,因此我想从发布 TAG 的开头删除 v 并从结尾删除 -internal 或 -external。
新版本的预期是1.0.0-alpha01
【问题讨论】:
标签: yaml pipeline release continuous-deployment github-actions