[英]Trying to call a workflow in a private repo under same organization but getting error
We are trying to call a workflow from a private repo under our organization.我们正在尝试从我们组织下的私人回购中调用工作流程。 Both repos are private repos under the same organization.
这两个回购都是同一组织下的私人回购。
Organisation A --> private - repo-1 / .github\workflows\qatest.yml
Organisation A --> private - repo-2 / .github\workflows\test.yml
But while running we are getting error like:但是在运行时我们会收到如下错误:
Error details:错误详情:
RequestError [HttpError]: Not Found
at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:6172:21
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
status: 404
repository 'https://github.com/somebookingtest/e2e-cypress/' not found
Could someone please advise on how to fix this issue here?有人可以建议如何在这里解决这个问题吗?
Below is the action from //repo2/ test.yml
以下是来自 //repo2/
test.yml
的操作
name: end to end testing
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
first:
name: end to end testing
uses: somebookingtest/e2e-cypres/.github/workflows/maintest.yml@main-fixes
permissions: read-all
with:
environment: qastaging
tag: "@e2etests"
second:
runs-on: ubuntu-latest
steps:
- name: Trigger Workflow
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'booking',
repo: 'e2e-cypres',
workflow_id: 'maintest.yml',
ref: 'main-fixes',
})
You have to use PAT - Personal Access Token instead of the default one - the default one only allows reading the active repository.您必须使用 PAT - 个人访问令牌而不是默认的 - 默认的只允许读取活动存储库。
github-token: ${{ secrets.MY_PAT }}
to your second job as documented heregithub-token: ${{ secrets.MY_PAT }}
到您的第二份工作,如此处记录name: end to end testing
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
first:
name: end to end testing
uses: somebookingtest/e2e-cypres/.github/workflows/maintest.yml@main-fixes
permissions: read-all
with:
environment: qastaging
tag: "@e2etests"
second:
runs-on: ubuntu-latest
steps:
- name: Trigger Workflow
uses: actions/github-script@v6
with:
github-token: ${{ secrets.MY_PAT }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'booking',
repo: 'e2e-cypres',
workflow_id: 'maintest.yml',
ref: 'main-fixes',
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.