Robocorp – 触发流程 GitHub Action 无法正常运行

huangapple go评论54阅读模式
英文:

Robocorp - Trigger process GitHub Action not working

问题

这是我在Robocorp论坛中的帖子的副本

我正在尝试使触发过程GitHub操作正常工作,但我遇到了以下错误:

错误:无法启动过程 - {"error":{"code":"NOT_AUTHORIZED","subCode":"","message":"未授权读取过程!"}}

上面的链接提到API密钥应该具有trigger_processes权限,而操作的存储库应该具有read_runstrigger_processes权限。无论如何,API密钥应该具有这两个权限,以及read_processes如图所示

我可以看到密钥正在使用,而且只有一个.github/workflow文件。工作流基本上与教程中的相同,但为了完整起见,这里是工作流的内容:

name: 触发控制室中的过程

on:
  pull_request:
    branches:
      - dev

jobs:
  run-process:
    runs-on: ubuntu-latest
    name: 触发过程
    steps:
      - name: 触发控制室过程运行
        uses: robocorp/action-trigger-process@v1
        with:
          api-key: ${{ secrets.ROBOCORP_WORKSPACE_KEY_TRIGGER }}
          workspace-id: ${{ secrets.ROBOCORP_WORKSPACE_ID }}
          process-id: ${{ secrets.ROBOCORP_PROCESS_ID }}
          payload: '{ "foo": "bar" }'
          await-complete: true

我还收到一个警告(“请更新以下操作以使用Node.js 16:robocorp/action-trigger-process@v1”),但我不认为这是问题所在。

我漏掉了什么?

谢谢

我按照教程的步骤进行操作,甚至将所有权限添加到API密钥。我删除了其他workflow .yml以帮助隔离任何问题。

英文:

This is a clone of my post in the Robocorp forum.

I’m trying to get the trigger process github action to work, but I’m getting:

Error: Failed to start process - {"error":{"code":"NOT_AUTHORIZED","subCode":"","message":"Not authorized to read process !"}}

The above link says the API key should have the trigger_processes permission and the action’s repo says it should have the read_runs and trigger_processes permissions. In any case, the API key those 2 permissions, as well as read_processes.

I can see that the key is being used, and there is only one .github/workflow file. The workflow is basically the same as the one in the tutorial but here it is for completeness:

name: Trigger a process in Control Room

on:
  pull_request:
    branches:
      - dev

jobs:
  run-process:
    runs-on: ubuntu-latest
    name: Trigger process
    steps:
      - name: Trigger Control Room process run
        uses: robocorp/action-trigger-process@v1
        with:
          api-key: ${{ secrets.ROBOCORP_WORKSPACE_KEY_TRIGGER }}
          workspace-id: ${{ secrets.ROBOCORP_WORKSPACE_ID }}
          process-id: ${{ secrets.ROBOCORP_PROCESS_ID }}
          payload: '{"foo":"bar"}'
          await-complete: true

I’m also getting a warning (Please update the following actions to use Node.js 16: robocorp/action-trigger-process@v1) but I don’t imagine that’s the issue.

What am I missing?

Thanks

I followed the tutorial, even added all of the permissions to the API key. I removed the other workflow .yml to help isolate any issues.

答案1

得分: 0

不用理会,看起来现在它正在工作。我猜我之前没有正确设置env.json或使用了正确的访问凭证。一旦我重置了访问凭证并在我的GitHub操作工作流程中设置了正确的步骤序列,这个操作就正常工作了。

英文:

Nevermind, it seems it's working now. I'm guessing I hadn't correctly set the env.json or used the correct access credentials. Once I reset the access credentials and set up a correct sequence of steps in my github actions workflow, this action worked fine.

huangapple
  • 本文由 发表于 2023年2月14日 21:39:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/75448673.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定