levonet.ci_github_rm_branch
CI:从 GitHub 仓库中删除分支
这个角色在合并 Pull Request 后的 CI 流水线中非常有用。
角色变量
ci_github_api
(默认值: https://api.github.com)ci_github_username
(必填):GitHub 用户名。ci_github_password
(必填):GitHub 访问令牌。ci_github_owner
(必填):GitHub 拥有者或组织名称。ci_github_repo
(必填):GitHub 项目仓库名称。ci_github_ref
(必填):GitHub 引用名称。ci_github_ignore_error
(默认值:yes):忽略任何错误。
示例剧本
- hosts: 127.0.0.1
connection: local
gather_facts: no
vars:
ci_github_username: ci-bot
ci_github_password: secret
ci_github_owner: myorg
ci_github_repo: myapp
ci_github_ref: "heads/{{ github_branch }}"
roles:
- role: levonet.ci_github_rm_branch
并在 Jenkins 中运行:
ansible-playbook myplaybook.yml -e github_branch="${X_GH_BRANCH}"
许可证
作者信息
此角色由 Pavlo Bashynskyi 创建。