如何使用 Bitbucket Pipelines 进行 git 标签发布 (bitbucket-pipelines.yml)

Get*_*toX 8 git git-tag bitbucket-pipelines

如何使用 bitbucket-pipelines.yml 文件在管道中标记 git 提交?

Get*_*toX 11

我的脚本如下。要使用它,您需要

  1. 在 Repo -> 设置 -> 管道 -> SSH 密钥中添加 SSH 密钥
  2. 公钥添加到团队或您配置文件 SSH 密钥
- step: &tag
  name: Tag version
  image: atlassian/default-image:2
  script:
    - git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}

    - dt=$(date '+%Y-%m-%d_%H%M');
    - git tag $dt ${BITBUCKET_COMMIT}
    - git push origin --tags
Run Code Online (Sandbox Code Playgroud)

这里有 pipeline-git 授权的完整文档:https://confluence.atlassian.com/bitbucket/push-back-to-your-repository-962352710.html