UNPKG

@atomist/sdm-pack-changelog

Version:

Extension Pack for an Atomist SDM to manage changelogs

59 lines 2.84 kB
"use strict"; /* * Copyright © 2018 Atomist, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); const automation_client_1 = require("@atomist/automation-client"); const sdm_1 = require("@atomist/sdm"); const changelogLabels_1 = require("./handler/command/changelogLabels"); const updateChangelog_1 = require("./handler/event/updateChangelog"); /** * Register support for managing CHANGELOG.md files in your SDM. * Note: If a goal gets passed to this function, this pack will * register a goal implementation for the given goal. * @param {Goal} goal * @returns {ExtensionPack} */ function changelogSupport() { return Object.assign(Object.assign({}, sdm_1.metadata()), { configure: sdm => { sdm.addCommand(changelogLabels_1.AddChangelogLabels); sdm.addEvent({ name: "UpdateChangelogOnIssue", description: "Update CHANGELOG.md on a closed label", tags: ["github", "changelog", "issue"], subscription: automation_client_1.GraphQL.subscription("closedIssueWithChangelogLabel"), paramsMaker: updateChangelog_1.TokenParameters, listener: updateChangelog_1.UpdateChangelogForIssueOrPullRequest, }) .addEvent({ name: "UpdateChangelogOnPullRequest", description: "Update CHANGELOG.md on a closed pull request", tags: ["github", "changelog", "pr"], subscription: automation_client_1.GraphQL.subscription("closedPullRequestWithChangelogLabel"), paramsMaker: updateChangelog_1.TokenParameters, listener: updateChangelog_1.UpdateChangelogForIssueOrPullRequest, }) .addEvent({ name: "UpdateChangelogOnPush", description: "Update CHANGELOG.md on a push", tags: ["github", "changelog", "commit"], subscription: automation_client_1.GraphQL.subscription("pushWithChangelogLabel"), paramsMaker: updateChangelog_1.TokenParameters, listener: updateChangelog_1.UpdateChangelogForCommit, }); } }); } exports.changelogSupport = changelogSupport; //# sourceMappingURL=changelog.js.map