npmpublish 不会触发npmhook
问题:
我定义了一个 slack 钩子,它连接到我们的 slack 工作区。它可以很好地从我的终端使用curl 调用并发送一条hello world 消息,很好!
所以现在我想添加一个带有 slack hook 端点的 npm hook。我添加了钩子: npm hook add <范围> <端点> <秘密>。我检查了一下是否添加了,是的。我发布了具有给定范围的新包版本。我收到一封有关更新的电子邮件,但未触发挂钩。我检查 npm 挂钩列表以查看挂钩是否已更新,我得到了“从未触发”。对于旧的钩子状态,我将其设置为“3天前触发”和“400”,但它从未触发松弛钩子。
预期:npmpublish 命令触发 npm 钩子,而 npm 钩子又触发 slack 钩子。
实际:没有 npm hook 触发,没有 slack hook 触发。
我尝试过的: 删除 npm 钩子并再次添加。将 slack 应用程序重新安装到工作区频道。在 npm 挂钩列表中添加了另一个范围。
一些代码: slack hook 的调用如下所示:curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https:// hooks.slack.com/services/
检查 npm hook ls 时,我得到:
You have 2 hooks configured.
┌──────────┬──────────────────────┬─────────────────────────────────────────────────────────────────────────────────┐
│ id │ target │ endpoint │
├──────────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ qfifmcgk │ @@<first-scope> │ https://hooks.slack.com/services/<id>/<id>/<id> │
│ ├──────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ │ triggered 3 days ago │ 400 │
├──────────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ jarhdqdc │ @@<second-scope> │ https://hooks.slack.com/services/<id>/<id>/<id> │
│ ├──────────────────────┴─────────────────────────────────────────────────────────────────────────────────┤
│ │ never triggered │
└──────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────┘
如何解决此问题?谢谢!
更新:我已将端点重定向到 apigw => lambda 触发松弛端点,这似乎有效。但!实际的 npm 触发非常(!)慢。我在 2022-03-22 14:52 发布了一个包,但触发器是在 2022-03-23 23:33 两天后初始化的。有谁知道这可能是什么原因造成的?
The problem:
I've defined a slack hook, which is connected to our slack workspace. It work perfectly fine to invoke with curl from my terminal with a hello world message, nice!
So now I would like to add a npm hook with the slack hook's endpoint. I add the hook:npm hook add <scope> <endpoint> <secret>
. I check to see if it's added, it is. I publish a new package version with the given scope. I get an email about the update, but the hook is not triggered. I check the npm hook list to see if the hook has been updated, I've got "never triggered". For the old hook status I have it as "triggered 3 days ago" and a "400", but it never triggered the slack hook.
Expected: The npm publish command trigger the npm hook which in turn trigger the slack hook.
Actual: No npm hook trigger, no slack hook triggered.
What I've tried:
Removed the npm hook and added it again. Reinstall slack app to workspace channel. Added another scope to npm hook list.
Some code:
The invokation of the slack hook is done like so: curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https://hooks.slack.com/services/<id>/<id>/<id>
, which works fine.
When checking the npm hook ls I get:
You have 2 hooks configured.
┌──────────┬──────────────────────┬─────────────────────────────────────────────────────────────────────────────────┐
│ id │ target │ endpoint │
├──────────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ qfifmcgk │ @@<first-scope> │ https://hooks.slack.com/services/<id>/<id>/<id> │
│ ├──────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ │ triggered 3 days ago │ 400 │
├──────────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ jarhdqdc │ @@<second-scope> │ https://hooks.slack.com/services/<id>/<id>/<id> │
│ ├──────────────────────┴─────────────────────────────────────────────────────────────────────────────────┤
│ │ never triggered │
└──────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────┘
How can I troubleshoot this? Thanks!
Update: I've redirected the endpoints to a apigw => lambda which triggers the slack endpoint, that seems to work. BUT! The actual npm triggering is very (!) slow. I published a package on 2022-03-22 14:52, but the trigger was initialised 2022-03-23 23:33, 2 days later. Anyone knows what might cause this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论