slackapi/[email protected] 中的有效负载文件路径问题

问题描述 投票:0回答:1

我正在尝试为 slackapi/[email protected] Github 操作中的有效负载文件路径编写工作流程.yml。我使用有效负载文件路径而不是有效负载。当我尝试运行工作流程文件时,我收到此错误

错误消息 -

Run Tests
Error: The payload-file-path may be incorrect. Failed to load the file: .github/resources/payload-slack-content.json

工作流程文件代码 -

       - name: Slack Notification
         id: slackPayloadFile
         uses: slackapi/[email protected]
         with:
          payload-file-path: ./.github/resources/payload-slack-content.json

完整日志-

Run slackapi/[email protected]
[Error: ENOENT: no such file or directory, open '/home/runner/work/actions/actions/.github/resources/payload-slack-content.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/runner/work/actions/actions/.github/resources/payload-slack-content.json'
}
Error: Error: The payload-file-path may be incorrect. Failed to load the file: .github/resources/payload-slack-content.json

请问有什么帮助吗?我正在使用这种 slack-api github actions 技术 - https://github.com/slackapi/slack-github-action#technique-3-slack-incoming-webhook

尝试更改路径格式但没有成功

github-actions slack-api
1个回答
0
投票

检查仓库是否有效。

这在

slackapi/slack-github-action
第104期

有说明

尝试在操作开始时检查存储库

在您的情况下,您的工作流程文件应该是:

name: Slack Notification Workflow

on:
  push:
    branches:
      - main

jobs:
  notify:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        
      - name: Slack Notification
        id: slackPayloadFile
        uses: slackapi/[email protected]
        with:
          payload-file-path: ./.github/resources/payload-slack-content.json
© www.soinside.com 2019 - 2024. All rights reserved.