GithubHelp home page GithubHelp logo

fateyan / action-discord-notifier Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 12.0 1.26 MB

Send commits log to discord via webhook, with your lovely GitHub Actions!

License: MIT License

JavaScript 100.00%
actions discord discord-webhook

action-discord-notifier's People

Contributors

binotaliu avatar dependabot[bot] avatar fateyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

action-discord-notifier's Issues

Posting with webhook returns error 400

When trying to post using discord webhook, getting error 400
That's all logs: ##[error]Post to webhook failed, Error: Request failed with status code 400

[Bug] - TypeError: Cannot read property 'map' of undefined

I'm getting the following error when trying to run an action when an issue is opened with a particular tag.

TypeError: Cannot read property 'map' of undefined
    at Object.562 (evalmachine.<anonymous>:23142:39)
    at __webpack_require__ (evalmachine.<anonymous>:22:30)
    at startup (evalmachine.<anonymous>:37:19)
    at evalmachine.<anonymous>:41:18
    at evalmachine.<anonymous>:44:10
    at Object.<anonymous> (/home/runner/work/_actions/fateyan/action-discord-notifier/v1.2.0/dist/index.js:5:28)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)

It looks like it fails at this line:

const commits = githubPayload.commits.map(i => ` - [\`[${shortSha(i.id)}]\`](${i.url}) ${escapeMd(i.message)} - by ${i.author.name}`)

Here is my workflow action for reference.

name: Discord Bug Report

on:
  issues:
    types: [opened]

jobs:
  notify:
    name: Discord Bug Report
    if: "contains(github.event.issue.labels.*.name, 'type:\ bug')"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - uses: fateyan/[email protected]
        with:
          message-title: New Bug Report
          webhook: <secret>

Better Documentation on Workflow Example

 Set up job
  LTS
Current runner version: '2.263.0'
Operating System
  Ubuntu
  18.04.4
  LTS
Virtual Environment
  Environment: ubuntu-18.04
  Version: 20200604.1
  Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20200604.1/images/linux/Ubuntu1804-README.md
Prepare workflow directory
Prepare all required actions
Download action repository 'binotaliu/[email protected]'
Run binotaliu/[email protected]
    webhook: ***
Run binotaliu/[email protected]
  with:
    webhook: ***
evalmachine.<anonymous>:23142
const commits = githubPayload.commits.map(i => ` - [\`[${shortSha(i.id)}]\`](${i.url}) ${escapeMd(i.message)} - by ${i.author.name}`)
                                      ^

TypeError: Cannot read property 'map' of undefined
    at Object.562 (evalmachine.<anonymous>:23142:39)
    at __webpack_require__ (evalmachine.<anonymous>:22:30)
    at startup (evalmachine.<anonymous>:37:19)
    at evalmachine.<anonymous>:41:18
    at evalmachine.<anonymous>:44:10
    at Object.<anonymous> (/home/runner/work/_actions/binotaliu/action-discord-notifier/v1.2.0/dist/index.js:5:28)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.