Skip to content

Commit

Permalink
use MICROSOFT_TEAMS_WEBHOOK_URL env var
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Oct 21, 2020
1 parent c454dbf commit 1ab9f78
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions plugins/microsoft-teams/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
import { HttpsProxyAgent } from "https-proxy-agent";

import { Auto, InteractiveInit } from "@auto-it/core";
import SlackPlugin from "@auto-it/slack";
import SlackPlugin, { ISlackPluginOptions } from "@auto-it/slack";
import fetch from "node-fetch";

/** Post your release notes to Slack during `auto release` */
export default class MicrosoftTeamsPlugin extends SlackPlugin {
/** The name of the plugin */
name = "microsoft-teams";

/** Initialize the plugin with it's options */
constructor(options: ISlackPluginOptions | string = {}) {
super(
typeof options === "string"
? options
: {
...options,
url: process.env.MICROSOFT_TEAMS_WEBHOOK_URL || options.url || "",
}
);
}

/** Custom initialization for this plugin */
init(initializer: InteractiveInit) {
initializer.hooks.createEnv.tapPromise(this.name, async (vars) => [
...vars,
{
variable: "SLACK_WEBHOOK_URL",
variable: "MICROSOFT_TEAMS_WEBHOOK_URL",
message: "What is the root url of your slack hook? ()",
},
]);
Expand Down

0 comments on commit 1ab9f78

Please sign in to comment.