All Projects → dessant → probot-messages

dessant / probot-messages

Licence: MIT license
Probot extension for communicating with repository maintainers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to probot-messages

serverless-gcf
An extension for running Probot on Google Cloud Functions
Stars: ✭ 15 (+15.38%)
Mutual labels:  probot, probot-extension
vue-blog
使用 Vue 和 Github Issues 搭建的 SPA Blog
Stars: ✭ 18 (+38.46%)
Mutual labels:  github-api, github-issues
github-interact-cli
🎩 Interact with GItHub right inside your terminal
Stars: ✭ 43 (+230.77%)
Mutual labels:  github-api, github-issues
Trop
automate the backporting process
Stars: ✭ 59 (+353.85%)
Mutual labels:  probot, github-api
probot-config
A Probot extension to easily share configs between repositories.
Stars: ✭ 63 (+384.62%)
Mutual labels:  probot, probot-extension
commands
A Probot extension that adds slash commands to GitHub
Stars: ✭ 54 (+315.38%)
Mutual labels:  probot, probot-extension
scalafmt-probot
🤖Github bot for checking code formatting with scalafmt
Stars: ✭ 15 (+15.38%)
Mutual labels:  probot, github-api
react-preview
a GitHub App built with probot that generates preview links for react based projects.
Stars: ✭ 14 (+7.69%)
Mutual labels:  probot, github-api
Probot Gpg
A GitHub App that enforces GPG signatures on pull requests (no longer maintained)
Stars: ✭ 13 (+0%)
Mutual labels:  probot, github-api
scheduler
⚠️ Archived
Stars: ✭ 46 (+253.85%)
Mutual labels:  probot, probot-extension
gh
Control GitHub from your Terminal
Stars: ✭ 28 (+115.38%)
Mutual labels:  github-api
gitbot
The most popular Discord dev toolkit with 400k+ users 🚀✨
Stars: ✭ 59 (+353.85%)
Mutual labels:  github-api
useful-forks.github.io
Improving GitHub's Forks list discoverability through automatic filtering. The project offers an online tool and a Chrome extension.
Stars: ✭ 917 (+6953.85%)
Mutual labels:  github-api
branch-switcher
a GitHub bot that switches the base branch of pull requests to the preferred branch
Stars: ✭ 15 (+15.38%)
Mutual labels:  probot
gitamp
Listen to music generated by events across github.
Stars: ✭ 29 (+123.08%)
Mutual labels:  github-api
Giter
Quickly set up a new remote repository, initialize a local git repository and add the remote repo
Stars: ✭ 38 (+192.31%)
Mutual labels:  github-api
issue-collab
A GitHub Issues searcher inspired by Hacktoberfest
Stars: ✭ 26 (+100%)
Mutual labels:  github-issues
probot-lambda
Test for running probot in AWS Lambda
Stars: ✭ 25 (+92.31%)
Mutual labels:  probot
RxSwift-MVVM-iOS
SwiftMVVM is an sample iOS App written in Swift using the MVVM architecture.
Stars: ✭ 96 (+638.46%)
Mutual labels:  github-api
spotify-playing-readme
A really easy way to display your spotify listening status on READMEs and Website.
Stars: ✭ 21 (+61.54%)
Mutual labels:  github-api

Probot Messages

A Probot extension for communicating with repository maintainers. It is used for delivering messages that require user action to ensure the correct operation of the app, such as configuring the app after installation, or fixing configuration errors.

How It Works

A new issue is opened for messages that don't already have an open issue, otherwise an optional update is posted on the existing issue in the form of a comment.

Usage

$ npm install probot-messages

Required permissions

  • Issues - Read & Write
  • Repository metadata - Read-only

Examples

Notify maintainers about additional configuration steps.

const sendMessage = require('probot-messages');

module.exports = app => {
  app.on('installation_repositories.added', async context => {
    for (const item of context.payload.repositories_added) {
      const [owner, repo] = item.full_name.split('/');
      await sendMessage(
        app,
        context,
        '[{appName}] Getting started',
        'Follow these steps to configure the app...',
        {owner, repo}
      );
    }
  });
};

Notify maintainers about configuration errors.

const sendMessage = require('probot-messages');

module.exports = app => {
  app.on('push', async context => {
    const configFile = 'config.yml';
    try {
      const config = await context.config(configFile);
    } catch (error) {
      if (error.name === 'YAMLException') {
        await sendMessage(
          app,
          context,
          '[{appName}] Configuration error',
          '[{appName}]({appUrl}) has encountered a configuration error in ' +
            `\`${configFile}\`.\n\`\`\`\n${error.toString()}\n\`\`\``,
          {update: 'The configuration error is still occurring.'}
        );
      }
    }
  });
};

API

sendMessage

Messages repository maintainers by submitting an issue.

Parameters

  • app Object app instance
  • context Object event context
  • title string issue title, {appName} and {appUrl} are optional placeholders
  • message string issue content, {appName} and {appUrl} are optional placeholders
  • options Object? options (optional, default {})
    • options.update string? update to post as a comment, {appName} and {appUrl} are optional placeholders, no update is posted if the value is falsy or the issue is locked (optional, default '')
    • options.updateAfterDays number? post update only if the issue had no activity in this many days (optional, default 7)
    • options.owner string? owner of the repository (optional, default value inferred from context)
    • options.repo string? repository (optional, default value inferred from context)

Examples

const sendMessage = require('probot-messages');

module.exports = app => {
  app.on('issue_comment.created', async context => {
    await sendMessage(app, context, 'Title', 'Message');
  });
};

Returns Promise<Message> Promise that will be fulfilled with a Message object

Message

Details of the message.

Type: Object

Properties

  • owner string owner of the repository
  • repo string repository
  • issue number issue number of the message
  • comment number? comment ID of the update
  • isNew boolean indicates if the issue was newly created

License

Copyright (c) 2018-2021 Armin Sebastian

This software is released under the terms of the MIT License. See the LICENSE file for further information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].