fateyan / action-discord-notifier Goto Github PK
View Code? Open in Web Editor NEWSend commits log to discord via webhook, with your lovely GitHub Actions!
License: MIT License
Send commits log to discord via webhook, with your lovely GitHub Actions!
License: MIT License
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
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>
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.