← GitHub + Line integrations

Send Broadcast Message with Line API on New Commit (Instant) from GitHub API

Pipedream makes it easy to connect APIs for Line, GitHub and 1000+ other apps remarkably fast.

Trigger workflow on
New Commit (Instant) from the GitHub API
Next, do this
Send Broadcast Message with the Line API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜

Trusted by 500,000+ developers from startups to Fortune 500 companies

Adyen logo
Brex logo
Carta logo
Checkr logo
Chameleon logo
DevRev logo
LinkedIn logo
Netflix logo
New Relic logo
OnDeck logo
Replicated logo
Scale AI logo
Teamwork logo
Warner Bros. logo
Xendit logo

Developers Pipedream

Getting Started

This integration creates a workflow with a GitHub trigger and Line action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Commit (Instant) trigger
    1. Connect your GitHub account
    2. Select a Repository
    3. Optional- Select a Branch
  3. Configure the Send Broadcast Message action
    1. Connect your Line account
    2. Configure Channel Access Token
    3. Configure Message Text
    4. Optional- Configure Disable Notification
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new events on new commits to a repo or branch
Version:0.1.8
Key:github-new-commit

Trigger Code

import common from "../common/common-webhook.mjs";
import constants from "../common/constants.mjs";

export default {
  ...common,
  key: "github-new-commit",
  name: "New Commit (Instant)",
  description: "Emit new events on new commits to a repo or branch",
  version: "0.1.8",
  type: "source",
  dedupe: "unique",
  props: {
    ...common.props,
    branch: {
      propDefinition: [
        common.props.github,
        "branch",
        (c) => ({
          repoFullname: c.repoFullname,
        }),
      ],
      description: "Branch to monitor for new commits. Defaults to master",
      optional: true,
      withLabel: true,
    },
  },
  methods: {
    ...common.methods,
    getWebhookEvents() {
      return [
        "push",
      ];
    },
    isEventForThisBranch(branch) {
      return !this.branch || branch === this.branch.label;
    },
    generateMeta(data) {
      return {
        id: data.id,
        summary: data.message,
        ts: Date.parse(data.timestamp),
      };
    },
    async loadHistoricalEvents() {
      const commitInfo = await this.github.getCommits({
        repoFullname: this.repoFullname,
        sha: this.branch
          ? this.branch.value
          : undefined,
        per_page: constants.HISTORICAL_EVENTS,
      });
      const commits = commitInfo.map((info) => ({
        id: info.commit.url.split("/").pop(),
        timestamp: info.commit.committer.date,
        ...info.commit,
      }));
      this.processCommits(commits);
    },
    processCommits(commits) {
      for (const commit of commits) {
        const meta = this.generateMeta(commit);
        this.$emit(commit, meta);
      }
    },
  },
  async run(event) {
    const { body } = event;

    // skip initial response from Github
    if (body?.zen) {
      console.log(body.zen);
      return;
    }

    const branch = body.ref.split("refs/heads/").pop();
    if (!this.isEventForThisBranch(branch)) {
      return;
    }

    this.processCommits(body.commits);
  },
};

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
GitHubgithubappThis component uses the GitHub app.
RepositoryrepoFullnamestringSelect a value from the drop down menu.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
N/Ahttp$.interface.httpThis component uses $.interface.http to generate a unique URL when the component is first instantiated. Each request to the URL will trigger the run() method of the component.
BranchbranchstringSelect a value from the drop down menu.

Trigger Authentication

GitHub uses OAuth authentication. When you connect your GitHub account, Pipedream will open a popup window where you can sign into GitHub and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any GitHub API.

Pipedream requests the following authorization scopes when you connect your account:

repoadmin:orgadmin:public_keyadmin:org_hookgistprojectnotificationsuserwrite:discussionwrite:packagesread:packagesadmin:repo_hook

About GitHub

Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.

Action

Description:Sends a broadcast message to multiple users at any time. [See docs](https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message)
Version:0.0.2
Key:line-send-broadcast-message

Line Overview

The Line API allows developers to create all sorts of applications that
interact with Line's messaging platform. Here are some examples of what you can
build:

  • A bot that responds to messages from users
  • A bot that helps users buy tickets or make reservations
  • A bot that sends notifications or updates to users
  • A bot that helps users track their orders or shipments
  • A bot that provides customer support
  • A bot that helps users find restaurants or other businesses

Action Code

import line from "../../line.app.mjs";

export default {
  name: "Send Broadcast Message",
  description: "Sends a broadcast message to multiple users at any time. [See docs](https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message)",
  key: "line-send-broadcast-message",
  version: "0.0.2",
  type: "action",
  props: {
    line,
    channelAccessToken: {
      propDefinition: [
        line,
        "channelAccessToken",
      ],
    },
    message: {
      propDefinition: [
        line,
        "message",
      ],
    },
    notificationDisabled: {
      propDefinition: [
        line,
        "notificationDisabled",
      ],
    },
  },
  async run() {
    return this.line.sendBroadcastMessage(this.channelAccessToken, {
      type: "text",
      text: this.message,
      notificationDisabled: this.notificationDisabled ?? false,
    });
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
LinelineappThis component uses the Line app.
Channel Access TokenchannelAccessTokenstring

The access token of a group or room. Please refer to the Line doc here to get the channel access token

Message Textmessagestring

The text of message to be send.

Disable NotificationnotificationDisabledboolean

The user will receive a push notification when the message is sent.

Action Authentication

Line uses OAuth authentication. When you connect your Line account, Pipedream will open a popup window where you can sign into Line and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Line API.

Pipedream requests the following authorization scopes when you connect your account:

notify

About Line

Messaging

More Ways to Connect Line + GitHub

Create Branch with GitHub API on New Message Received from Line API
Line + GitHub
 
Try it
Create Issue with GitHub API on New Message Received from Line API
Line + GitHub
 
Try it
Create Issue Comment with GitHub API on New Message Received from Line API
Line + GitHub
 
Try it
Create or update file contents with GitHub API on New Message Received from Line API
Line + GitHub
 
Try it
Create Repository with GitHub API on New Message Received from Line API
Line + GitHub
 
Try it
New Branch (Instant) from the GitHub API

Emit new events when a new branch is created

 
Try it
New Card in Column (Classic Projects) from the GitHub API

Emit new event when a (classic) project card is created or moved to a specific column. For Projects V2 use New Issue with Status trigger. More information here

 
Try it
New Collaborator (Instant) from the GitHub API

Emit new events when collaborators are added to a repo

 
Try it
New Commit (Instant) from the GitHub API

Emit new events on new commits to a repo or branch

 
Try it
New Commit Comment (Instant) from the GitHub API

Emit new events on new commit comments

 
Try it
Create Issue with the GitHub API

Create a new issue in a Gihub repo. See docs here

 
Try it
Search Issues and Pull Requests with the GitHub API

Find issues and pull requests by state and keyword. See docs here

 
Try it
Create Branch with the GitHub API

Create a new branch in a Github repo. See docs here

 
Try it
Create Issue Comment with the GitHub API

Create a new comment in a issue. See docs here

 
Try it
Create or update file contents with the GitHub API

Create or update a file in a repository. This will replace an existing file. See docs here

 
Try it