Open
Description
Hi,
unfortunately this package does not recognize proxy settings. I fixed that by using @actions/http-client
:
diff --git a/src/MSTeams.js b/src/MSTeams.js
index a4a4bf0..9ef2f1f 100644
--- a/src/MSTeams.js
+++ b/src/MSTeams.js
@@ -1,6 +1,7 @@
const {IncomingWebhook} = require('ms-teams-webhook');
const {context: github} = require('@actions/github');
const core = require('@actions/core');
+const http = require('@actions/http-client');
const placeholder = '';
const {
@@ -277,8 +278,8 @@ class MSTeams {
* @returns {Promise} result
*/
async notify(url, payload) {
- const client = new IncomingWebhook(url);
- const response = await client.send(payload);
+ const client = new http.HttpClient();
+ const response = await client.postJson(url, payload);
if (!response.text) {
throw new Error('Failed to send notification to Microsoft Teams.\n' + 'Response:\n' + JSON.stringify(response, null, 2));
I'd like to make a pull request, but unfortunately I'm an absolute noob in regards to NodeJS/npm and my pre-commit hook keeps failing. Maybe you can implement this yourself, since @actions/http-client
works with proxy settings.
Cheers,
Marco
Metadata
Metadata
Assignees
Labels
No labels