mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
24 lines
496 B
JavaScript
24 lines
496 B
JavaScript
import axios from "axios"
|
|
|
|
export default 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
|
|
}
|