Some Fixes
This commit is contained in:
parent
a8df6bca4c
commit
6a52ab38cb
16
.github/discord.js
vendored
16
.github/discord.js
vendored
@ -1,17 +1,11 @@
|
|||||||
const bot_token = process.env['BOT_TOKEN']
|
const bot_token = process.env['BOT_TOKEN']
|
||||||
|
const tag = process.env['TAG']
|
||||||
|
const body = process.env['BODY']
|
||||||
|
const channel = process.env['CHANNEL']
|
||||||
const { request } = require('https')
|
const { request } = require('https')
|
||||||
|
|
||||||
let tag = undefined, body = undefined, channel = undefined;
|
|
||||||
|
|
||||||
process.argv.forEach((arg) => {
|
|
||||||
const [ key, value ] = arg.split('=')
|
|
||||||
if(key === 'tag') tag = value
|
|
||||||
if(key === 'body') body = value
|
|
||||||
if(key === 'channel') channel = value
|
|
||||||
})
|
|
||||||
|
|
||||||
if(!tag || !body || !channel) {
|
if(!tag || !body || !channel) {
|
||||||
console.log(`Some args are missing`)
|
console.log(`TAG || BODY || Channel missing`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
else if(!bot_token) {
|
else if(!bot_token) {
|
||||||
@ -35,8 +29,6 @@ else if(!bot_token) {
|
|||||||
embeds : [embed]
|
embeds : [embed]
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(payload)
|
|
||||||
|
|
||||||
const x = await https_getter(`https://discord.com/api/v9/channels/${channel}/messages`, {
|
const x = await https_getter(`https://discord.com/api/v9/channels/${channel}/messages`, {
|
||||||
headers : {
|
headers : {
|
||||||
"Authorization" : `Bot ${bot_token}`,
|
"Authorization" : `Bot ${bot_token}`,
|
||||||
|
|||||||
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
@ -67,6 +67,9 @@ jobs:
|
|||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- name: Publish on discord
|
- name: Publish on discord
|
||||||
run: node .github/discord.js channel="888999793458835466" body="${{ github.event.release.body }}" tag="${{ github.event.release.tag_name }}"
|
run: node .github/discord.js
|
||||||
env:
|
env:
|
||||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||||
|
CHANNEL: 888999793458835466
|
||||||
|
BODY: ${{ github.event.release.body }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
Loading…
x
Reference in New Issue
Block a user