mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
25 lines
618 B
JavaScript
25 lines
618 B
JavaScript
const axios = require("axios")
|
|
|
|
async function createGithubRelease(repo, payload, token) {
|
|
const { version, changelog } = payload
|
|
|
|
const response = await axios({
|
|
method: "post",
|
|
url: `https://api.github.com/repos/${repo}/releases`,
|
|
headers: {
|
|
"Authorization": `token ${token}`,
|
|
"Content-Type": "application/json"
|
|
},
|
|
data: {
|
|
tag_name: version,
|
|
name: `v${version}`,
|
|
body: changelog
|
|
}
|
|
})
|
|
|
|
console.log("⚒ Creating release done!")
|
|
|
|
return response.data
|
|
}
|
|
|
|
module.exports = createGithubRelease |