12 Commits
1.0.5 ... 1.0.7

Author SHA1 Message Date
guanhongfu
46370aa1f7 feat: 升级依赖;文件结构优化;异常处理优化; 2022-04-27 10:20:40 +08:00
guanhongfu
f99560aa94 feat: 补全 action.yml inputs 参数,消除警告;升级一些库的依赖; 2021-12-27 13:47:39 +08:00
chf007
89f4ffaa53 Update README.md 2021-12-20 12:09:25 +08:00
chf007
6df0f2f152 Merge pull request #12 from chf007/dependabot/npm_and_yarn/axios-0.21.2
Bump axios from 0.21.1 to 0.21.2
2021-09-10 23:35:49 +08:00
chf007
7ecbb4de6c Update LICENSE 2021-09-10 15:41:45 +08:00
dependabot[bot]
9c8d16d926 Bump axios from 0.21.1 to 0.21.2
Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 07:41:19 +00:00
chf007
c6d92613c7 Delete .DS_Store 2021-09-10 15:40:56 +08:00
chf007
2903b97062 Merge pull request #11 from fanchou/master
添加构建依赖,添加多平台测试任务
2021-05-07 18:49:09 +08:00
周凡
59ba9c8152 ++ 2021-05-07 16:42:24 +08:00
周凡
8b2766073f ++ 2021-05-07 16:34:57 +08:00
zhoufan
cadaf675dd 忽略文件 2021-05-07 16:08:09 +08:00
zhoufan
e9738beb79 添加构建依赖,添加多平台测试任务 2021-05-07 16:07:16 +08:00
17 changed files with 4557 additions and 25975 deletions

View File

@@ -3,7 +3,10 @@ on: [push]
jobs:
send-msg:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
# 纯文本类型
- name: WeChat Work notification by text

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
node_modules
/.idea
/.DS_Store

View File

@@ -1,17 +0,0 @@
FROM mhart/alpine-node:10.15.1
LABEL "com.github.actions.name"="GitHub Action for WeChat Work"
LABEL "com.github.actions.description"="Send WeChat Work message. Run on any operating platform, such as Windows, Linux, Mac supported by GitHub"
LABEL "com.github.actions.icon"="message-circle"
LABEL "com.github.actions.color"="red"
LABEL "repository"="https://github.com/chf007/action-wechat-work"
LABEL "homepage"="https://github.com/chf007/action-wechat-work"
LABEL "maintainer"="chf007 <chf007server@gmail.com>"
LABEL "version"="1.0.4"
ADD entrypoint.js package.json package-lock.json /
RUN npm ci
RUN chmod +x /entrypoint.js
ENTRYPOINT ["node", "/entrypoint.js"]

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020-present chf007
Copyright (c) 2020-present chf007 and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,8 +1,8 @@
# WeChat Work for GitHub Actions
通过企业微信机器人发送消息
通过企业微信机器人发送消息
![WeChat Work Logo](wechat-work-logo.png "WeChat Work Logo")
![WeChat Work Logo](./docs/wechat-work-logo.png "WeChat Work Logo")
<hr/>
@@ -10,7 +10,7 @@
### 纯文本格式消息
![WeChat Work message](wechat-work-msg-text.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-text.png "WeChat Work message")
```yaml
- name: WeChat Work notification by text
@@ -24,16 +24,16 @@
mentioned_mobile_list: '["13800001111","@all"]'
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 text
content | true | 文本内容,最长不超过 2048 个字节,必须是 utf8 编码
mentioned_list | false | userid 的列表,提醒群中的指定成员(@某个成员)@all表示提醒所有人,如果开发者获取不到 userid可以使用 mentioned_mobile_list必须是序列化后的 JSON 字符串
mentioned_mobile_list | false | 手机号列表,提醒手机号对应的群成员(@某个成员)@all表示提醒所有人,必须是序列化后的 JSON 字符串
| 参数 | 必须 | 说明 |
|-----------------------|-------|-------------------------------------------------------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 text |
| content | true | 文本内容,最长不超过 2048 个字节,必须是 utf8 编码 |
| mentioned_list | false | userid 的列表,提醒群中的指定成员(@某个成员)@all表示提醒所有人,如果开发者获取不到 userid可以使用 mentioned_mobile_list必须是序列化后的 JSON 字符串 |
| mentioned_mobile_list | false | 手机号列表,提醒手机号对应的群成员(@某个成员)@all表示提醒所有人,必须是序列化后的 JSON 字符串 |
### Markdown 格式消息
![WeChat Work message](wechat-work-msg-markdown.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-markdown.png "WeChat Work message")
```yaml
- name: WeChat Work notification by markdown
@@ -48,14 +48,14 @@ mentioned_mobile_list | false | 手机号列表,提醒手机号对应的群成
> VIP用户反馈:<font color=\"comment\">15例</font>"
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 markdown
content | true | markdown 内容,最长不超过 4096 个字节,必须是 utf8 编码 支持的格式详见 https://work.weixin.qq.com/api/doc/90000/90136/91770
| 参数 | 必须 | 说明 |
|---------|------|-----------------------------------------------------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 markdown |
| content | true | markdown 内容,最长不超过 4096 个字节,必须是 utf8 编码 支持的格式详见 https://work.weixin.qq.com/api/doc/90000/90136/91770 |
### 图片格式消息
![WeChat Work message](wechat-work-msg-image.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-image.png "WeChat Work message")
```yaml
- name: WeChat Work notification by image
@@ -68,15 +68,15 @@ content | true | markdown 内容,最长不超过 4096 个字节,必须是 ut
md5: 0582d8564cdee3187207666898f75205
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 image
base64 | true | 图片内容的 base64 编码 注图片base64 编码前)最大不能超过 2 M支持 JPG、PNG 格式
md5 | true | 图片内容base64 编码前)的 md5 值
| 参数 | 必须 | 说明 |
|---------|------|----------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 image |
| base64 | true | 图片内容的 base64 编码 注图片base64 编码前)最大不能超过 2 M支持 JPG、PNG 格式 |
| md5 | true | 图片内容base64 编码前)的 md5 值 |
### 图文格式消息
![WeChat Work message](wechat-work-msg-news.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-news.png "WeChat Work message")
```yaml
- name: WeChat Work notification by news
@@ -85,20 +85,20 @@ md5 | true | 图片内容base64 编码前)的 md5 值
WECHAT_WORK_BOT_WEBHOOK: ${{secrets.WECHAT_WORK_BOT_WEBHOOK}}
with:
msgtype: news
articles: '[{"title":"中秋节礼品领取","description":"今年中秋节公司有豪礼相送","url":"URL","picurl":"http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png"}]'
articles: '[{"title":"中秋节礼品领取","description":"今年中秋节公司有豪礼相送","url":"URL","picurl":"https://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png"}]'
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 news
articles | true | 图文消息,一个图文消息支持 1 到 8 条图文,必须是序列化后的 JSON 字符串
articles.title | true | 标题,不超过 128 个字节,超过会自动截断
articles.description | false | 描述,不超过 512 个字节,超过会自动截断
articles.url | false | 点击后跳转的链接。
articles.picurl | false | 图文消息的图片链接,支持 JPG、PNG 格式,较好的效果为大图 1068*455小图 150*150。
| 参数 | 必须 | 说明 |
|----------------------|-------|-------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 news |
| articles | true | 图文消息,一个图文消息支持 1 到 8 条图文,必须是序列化后的 JSON 字符串 |
| articles.title | true | 标题,不超过 128 个字节,超过会自动截断 |
| articles.description | false | 描述,不超过 512 个字节,超过会自动截断 |
| articles.url | false | 点击后跳转的链接。 |
| articles.picurl | false | 图文消息的图片链接,支持 JPG、PNG 格式,较好的效果为大图 1068*455小图 150*150。 |
### 文件格式消息
![WeChat Work message](wechat-work-msg-file.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-file.png "WeChat Work message")
```yaml
- name: WeChat Work notification by file
@@ -110,10 +110,10 @@ articles.picurl | false | 图文消息的图片链接,支持 JPG、PNG 格式
media_id: 3a8asd892asd8asd
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 file
media_id | true | 文件 id通过 [文件上传接口](https://work.weixin.qq.com/api/doc/90000/90136/91770) 获取
| 参数 | 必须 | 说明 |
|----------|------|----------------------------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 file |
| media_id | true | 文件 id通过 [文件上传接口](https://work.weixin.qq.com/api/doc/90000/90136/91770) 获取 |
### WECHAT_WORK_BOT_WEBHOOK

View File

@@ -2,7 +2,7 @@
通过企业微信机器人发送消息
![WeChat Work Logo](wechat-work-logo.png "WeChat Work Logo")
![WeChat Work Logo](./docs/wechat-work-logo.png "WeChat Work Logo")
<hr/>
@@ -10,7 +10,7 @@
### 纯文本格式消息
![WeChat Work message](wechat-work-msg-text.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-text.png "WeChat Work message")
```yaml
- name: WeChat Work notification by text
@@ -24,16 +24,16 @@
mentioned_mobile_list: '["13800001111","@all"]'
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 text
content | true | 文本内容,最长不超过 2048 个字节,必须是 utf8 编码
mentioned_list | false | userid 的列表,提醒群中的指定成员(@某个成员)@all表示提醒所有人,如果开发者获取不到 userid可以使用 mentioned_mobile_list必须是序列化后的 JSON 字符串
mentioned_mobile_list | false | 手机号列表,提醒手机号对应的群成员(@某个成员)@all表示提醒所有人,必须是序列化后的 JSON 字符串
| 参数 | 必须 | 说明 |
|-----------------------|-------|-------------------------------------------------------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 text |
| content | true | 文本内容,最长不超过 2048 个字节,必须是 utf8 编码 |
| mentioned_list | false | userid 的列表,提醒群中的指定成员(@某个成员)@all表示提醒所有人,如果开发者获取不到 userid可以使用 mentioned_mobile_list必须是序列化后的 JSON 字符串 |
| mentioned_mobile_list | false | 手机号列表,提醒手机号对应的群成员(@某个成员)@all表示提醒所有人,必须是序列化后的 JSON 字符串 |
### Markdown 格式消息
![WeChat Work message](wechat-work-msg-markdown.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-markdown.png "WeChat Work message")
```yaml
- name: WeChat Work notification by markdown
@@ -48,14 +48,14 @@ mentioned_mobile_list | false | 手机号列表,提醒手机号对应的群成
> VIP用户反馈:<font color=\"comment\">15例</font>"
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 markdown
content | true | markdown 内容,最长不超过 4096 个字节,必须是 utf8 编码 支持的格式详见 https://work.weixin.qq.com/api/doc/90000/90136/91770
| 参数 | 必须 | 说明 |
|---------|------|-----------------------------------------------------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 markdown |
| content | true | markdown 内容,最长不超过 4096 个字节,必须是 utf8 编码 支持的格式详见 https://work.weixin.qq.com/api/doc/90000/90136/91770 |
### 图片格式消息
![WeChat Work message](wechat-work-msg-image.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-image.png "WeChat Work message")
```yaml
- name: WeChat Work notification by image
@@ -68,15 +68,15 @@ content | true | markdown 内容,最长不超过 4096 个字节,必须是 ut
md5: 0582d8564cdee3187207666898f75205
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 image
base64 | true | 图片内容的 base64 编码 注图片base64 编码前)最大不能超过 2 M支持 JPG、PNG 格式
md5 | true | 图片内容base64 编码前)的 md5 值
| 参数 | 必须 | 说明 |
|---------|------|----------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 image |
| base64 | true | 图片内容的 base64 编码 注图片base64 编码前)最大不能超过 2 M支持 JPG、PNG 格式 |
| md5 | true | 图片内容base64 编码前)的 md5 值 |
### 图文格式消息
![WeChat Work message](wechat-work-msg-news.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-news.png "WeChat Work message")
```yaml
- name: WeChat Work notification by news
@@ -85,20 +85,20 @@ md5 | true | 图片内容base64 编码前)的 md5 值
WECHAT_WORK_BOT_WEBHOOK: ${{secrets.WECHAT_WORK_BOT_WEBHOOK}}
with:
msgtype: news
articles: '[{"title":"中秋节礼品领取","description":"今年中秋节公司有豪礼相送","url":"URL","picurl":"http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png"}]'
articles: '[{"title":"中秋节礼品领取","description":"今年中秋节公司有豪礼相送","url":"URL","picurl":"https://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png"}]'
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 news
articles | true | 图文消息,一个图文消息支持 1 到 8 条图文,必须是序列化后的 JSON 字符串
articles.title | true | 标题,不超过 128 个字节,超过会自动截断
articles.description | false | 描述,不超过 512 个字节,超过会自动截断
articles.url | false | 点击后跳转的链接。
articles.picurl | false | 图文消息的图片链接,支持 JPG、PNG 格式,较好的效果为大图 1068*455小图 150*150。
| 参数 | 必须 | 说明 |
|----------------------|-------|-------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 news |
| articles | true | 图文消息,一个图文消息支持 1 到 8 条图文,必须是序列化后的 JSON 字符串 |
| articles.title | true | 标题,不超过 128 个字节,超过会自动截断 |
| articles.description | false | 描述,不超过 512 个字节,超过会自动截断 |
| articles.url | false | 点击后跳转的链接。 |
| articles.picurl | false | 图文消息的图片链接,支持 JPG、PNG 格式,较好的效果为大图 1068*455小图 150*150。 |
### 文件格式消息
![WeChat Work message](wechat-work-msg-file.png "WeChat Work message")
![WeChat Work message](./docs/wechat-work-msg-file.png "WeChat Work message")
```yaml
- name: WeChat Work notification by file
@@ -110,10 +110,10 @@ articles.picurl | false | 图文消息的图片链接,支持 JPG、PNG 格式
media_id: 3a8asd892asd8asd
```
参数 | 必须 | 说明
------------ | ------------- | -------------
msgtype | true | 消息类型,此时固定为 file
media_id | true | 文件 id通过 [文件上传接口](https://work.weixin.qq.com/api/doc/90000/90136/91770) 获取
| 参数 | 必须 | 说明 |
|----------|------|----------------------------------------------------------------------------|
| msgtype | true | 消息类型,此时固定为 file |
| media_id | true | 文件 id通过 [文件上传接口](https://work.weixin.qq.com/api/doc/90000/90136/91770) 获取 |
### WECHAT_WORK_BOT_WEBHOOK

View File

@@ -8,9 +8,30 @@ branding:
inputs:
msgtype:
description: '消息类型'
description: '消息类型,当前支持 text markdown image news file'
required: true
content:
description: '当 msgtype=text 时:文本内容,最长不超过 2048 个字节,必须是 utf8 编码;当 msgtype=text 时markdown 内容,最长不超过 4096 个字节,必须是 utf8 编码 支持的格式详见 https://work.weixin.qq.com/api/doc/90000/90136/91770'
required: false
mentioned_list:
description: 'userid 的列表,提醒群中的指定成员(@某个成员)@all表示提醒所有人如果开发者获取不到 userid可以使用 mentioned_mobile_list必须是序列化后的 JSON 字符串'
required: false
mentioned_mobile_list:
description: '手机号列表,提醒手机号对应的群成员(@某个成员)@all表示提醒所有人必须是序列化后的 JSON 字符串'
required: false
base64:
description: '图片内容的 base64 编码 注图片base64 编码前)最大不能超过 2 M支持 JPG、PNG 格式'
required: false
md5:
description: '图片内容base64 编码前)的 md5 值'
required: false
articles:
description: '图文消息,一个图文消息支持 1 到 8 条图文,必须是序列化后的 JSON 字符串'
required: false
media_id:
description: '文件 id通过 [文件上传接口](https://work.weixin.qq.com/api/doc/90000/90136/91770) 获取'
required: false
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'

30057
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

268
package-lock.json generated
View File

@@ -1,139 +1,175 @@
{
"name": "action-wechat-work",
"version": "1.0.4",
"lockfileVersion": 1,
"version": "1.0.7",
"lockfileVersion": 2,
"requires": true,
"dependencies": {
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": {
"color-convert": "^2.0.1"
"packages": {
"": {
"name": "action-wechat-work",
"version": "1.0.7",
"license": "MIT",
"dependencies": {
"axios": "^0.27.1"
},
"devDependencies": {
"@vercel/ncc": "^0.33.4"
}
},
"node_modules/@vercel/ncc": {
"version": "0.33.4",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.4.tgz",
"integrity": "sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==",
"dev": true,
"bin": {
"ncc": "dist/ncc/cli.js"
}
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"node_modules/axios": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.27.1.tgz",
"integrity": "sha512-ePNMai55xo5GsXajb/k756AqZqpqeDaGwGcdvbZLSSELbbYwsIn2jNmGfUPEwd8j/yu4OoMstLLIVa4t0MneEA==",
"dependencies": {
"follow-redirects": "^1.14.9",
"form-data": "^4.0.0"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/follow-redirects": {
"version": "1.14.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
"integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
}
},
"dependencies": {
"@vercel/ncc": {
"version": "0.33.4",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.4.tgz",
"integrity": "sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==",
"dev": true
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.27.1.tgz",
"integrity": "sha512-ePNMai55xo5GsXajb/k756AqZqpqeDaGwGcdvbZLSSELbbYwsIn2jNmGfUPEwd8j/yu4OoMstLLIVa4t0MneEA==",
"requires": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.9",
"form-data": "^4.0.0"
}
},
"cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
"integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0"
"delayed-stream": "~1.0.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
"escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
"integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw=="
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"follow-redirects": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.0.tgz",
"integrity": "sha512-0vRwd7RKQBTt+mgu87mtYeofLFZpTas2S9zY+jIeuLJMNvudIgF52nr19q40HOwH5RrhWIPuj9puybzSJiRrVg=="
"version": "1.14.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
"integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w=="
},
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
},
"string-width": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
},
"mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"requires": {
"ansi-regex": "^5.0.0"
"mime-db": "1.52.0"
}
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
},
"y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
},
"yargs": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
},
"yargs-parser": {
"version": "20.2.7",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
"integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw=="
}
}
}

View File

@@ -1,10 +1,11 @@
{
"name": "action-wechat-work",
"version": "1.0.5",
"version": "1.0.7",
"description": "GitHub Action that sends a WeChat Work notification.",
"private": true,
"scripts": {
"test": "npm test"
"test": "npm test",
"build": "ncc build src/entrypoint.js"
},
"repository": {
"type": "git",
@@ -24,8 +25,9 @@
},
"homepage": "https://github.com/chf007/action-wechat-work#readme",
"dependencies": {
"axios": "^0.21.1",
"lodash": "^4.17.21",
"yargs": "^16.2.0"
"axios": "^0.27.1"
},
"devDependencies": {
"@vercel/ncc": "^0.33.4"
}
}

View File

@@ -1,6 +1,4 @@
const axios = require('axios');
const _ = require('lodash');
const { argv } = require('yargs');
const payload = {};
@@ -93,7 +91,8 @@ const url = process.env.WECHAT_WORK_BOT_WEBHOOK;
process.exit(0);
})()
.catch((err) => {
console.error(err.message);
console.error('Message sent error:', err.response.data);
console.error('Message sent error:');
err.message && console.error(err.message);
err.response && err.response.data && console.error(err.response.data);
process.exit(1);
});