从组织模板创建存储库后如何自动运行 Github 操作?

问题描述

使用 octokit 可以创建存在于组织中的存储库:

require("dotenv").config();

const { Octokit } = require("@octokit/rest");
const cwa = new Octokit({
  auth: process.env.TOKEN,//create Github personal token
});

const main = async (name) => {
  try {
    await cwa.repos.createUsingTemplate({
      template_owner: process.env.OWNER,template_repo: "org-template-repo",name,});
    console.log("repository successfully create ?");
  } catch (e) {
    console.log("error:",e);
  }
};

main();

在创建存储库后尝试自动化我在文档中没有找到在阅读 Workflow syntaxon 后检测模板存储库创建的方法

repo-created.yml:

name: Repo Template Used
on: [created]
jobs:
  greet-when-created:
    runs-on: ubuntu-latest
    steps:
      - run: echo "? The job was automatically triggered by a ${{ github.event_name }} event."
      - run: echo "? This job is Now running on a ${{ runner.os }} server hosted by GitHub!"
      - run: echo "? The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v2
      - run: echo "? The ${{ github.repository }} repository has been cloned to the runner."
      - run: echo "?️ The workflow is Now ready to test your code on the runner."
      - name: List files in the repository
        run: |
          ls ${{ github.workspace }}
      - run: echo "? This job's status is ${{ job.status }}."

但是 workflow_dispatch 需要输入。更多阅读/研究领域:

当从 API 或使用此模板使用组织的模板时,是否有办法触发 Github 操作?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...