如何从Github分支提交触发Ansible Tower作业模板?

Car*_*ole 5 ansible ansible-tower

如何在Github分支提交中使用其API在Ansible Tower中触发作业?

我可以使用Github webhook但是当被推送触发时,无论分支如何都会发生.我想知道webhook有效负载是否可以提供信息,但我不确定如何在工作中使用它.我是在正确的轨道还是有更好的方法?

谢谢.

Raf*_*Bem 1

您可以使用使用GitHub actions 和conditionals 的管道。例如:

on:
  # Trigger the workflow on push or pull request,
  # but only for the main branch
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
Run Code Online (Sandbox Code Playgroud)

取自这里