Version 1.8 (#5)
This commit is contained in:
@@ -2,15 +2,20 @@
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
import metrics from "../src/metrics.mjs"
|
||||
import build from "../utils/build.mjs"
|
||||
import octokit from "@octokit/graphql"
|
||||
import OctokitRest from "@octokit/rest"
|
||||
import libxmljs from "libxmljs"
|
||||
import url from "url"
|
||||
|
||||
//Dirname
|
||||
const __dirname = path.join(path.dirname(url.fileURLToPath(import.meta.url)), "..", "action")
|
||||
|
||||
//Die on unhandled rejections
|
||||
process.on("unhandledRejection", error => { throw error })
|
||||
|
||||
//Load GitHub handlers
|
||||
const token = process.argv.slice(2)[0] ?? ""
|
||||
const token = process.argv.slice(2)[0] ?? "73a71c11ec07d9b114f5e2af26a3cdde1c6fe65a"
|
||||
const graphql = octokit.graphql.defaults({headers:{authorization: `token ${token}`}})
|
||||
const rest = new OctokitRest.Octokit({auth:token})
|
||||
|
||||
@@ -25,4 +30,10 @@
|
||||
if (parsed.errors.length)
|
||||
throw new Error(`Malformed SVG : \n${parsed.errors.join("\n")}`)
|
||||
|
||||
//Ensure that action has been rebuild
|
||||
const action = `${await fs.promises.readFile(`${__dirname}/dist/index.js`)}`
|
||||
const code = await build()
|
||||
if (action !== code)
|
||||
throw new Error(`GitHub Action has not been rebuild. Run "npm run build" to solve this issue`)
|
||||
|
||||
console.log("Test success !")
|
||||
Reference in New Issue
Block a user