简体   繁体   English

尝试在同一组织下的私人仓库中调用工作流程但出现错误

[英]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 - 个人访问令牌而不是默认的 - 默认的只允许读取活动存储库。

  1. Create a personal access token 创建个人访问令牌
  2. Add it to your secrets 将其添加到您的秘密
  3. add: github-token: ${{ secrets.MY_PAT }} to your second job as documented here添加: github-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.

相关问题 将私人仓库中的自定义命令导入赛普拉斯仓库 - Import Custom Command in Private Repo into Cypress Repo 我正在尝试在 VS 中打开 Cypress,但不断收到此错误消息 - I am trying to open Cypress in VS but keep getting this error message cy.origin 在尝试调用具有 args 变量作为参数的 function 时抛出错误 - cy.origin throws error when trying to call a function which has the args's variable as a parameter 尝试运行 cypress 测试时出现错误“找不到模块‘./commands’” - Getting the error "Cannot find module './commands'" while trying to run cypress tests 收到 404 错误 | 服务器错误 | cy.visit() 尝试加载失败 - Getting 404 error | Server Error | cy.visit() failed trying to load 尝试在 ReactBoilerplate 存储库中进行 cypress react 单元测试 - Trying to get cypress react unit testing working within a ReactBoilerplate repo 赛普拉斯测试返回“TypeError: Cannot read property 'should' of undefined” 尝试在同一页面中调用方法 object class - Cypress test returning “TypeError: Cannot read property 'should' of undefined” when trying to call a method in the same page object class with 'this' 我是柏树+ TS的新手。 尝试使用 Cypress 和 Typescrpt 访问 iframe 内的元素时出错 - I am new to cypress+TS. Getting error while trying to access element inside the iframe using Cypress with Typescrpt 赛普拉斯测试组织 - Cypress test organization 在 Cypress 中多次拦截相同的 API 调用 - Intercept the same API call multiple times in Cypress
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM