Add option to verify SVG
This commit is contained in:
@@ -174,6 +174,12 @@ inputs:
|
|||||||
description: Enable debug logs
|
description: Enable debug logs
|
||||||
default: no
|
default: no
|
||||||
|
|
||||||
|
# Verify SVG after generation
|
||||||
|
# It tests whether SVG can be correctly parsed (used for testing)
|
||||||
|
verify:
|
||||||
|
description: Verify SVG after genaration
|
||||||
|
default: no
|
||||||
|
|
||||||
# Enable dry-run mode
|
# Enable dry-run mode
|
||||||
# Generate image but does not push it (used for testing)
|
# Generate image but does not push it (used for testing)
|
||||||
dryrun:
|
dryrun:
|
||||||
|
|||||||
99
action/dist/index.js
vendored
99
action/dist/index.js
vendored
@@ -910,6 +910,17 @@ var E_Users_lecoq_Documents_GitHub_gitstats_node_modules_actions_github_lib_gith
|
|||||||
const rendered = await metrics({login:user, q}, {graphql, rest, plugins, conf, die})
|
const rendered = await metrics({login:user, q}, {graphql, rest, plugins, conf, die})
|
||||||
console.log(`Render | complete`)
|
console.log(`Render | complete`)
|
||||||
|
|
||||||
|
//Verify svg
|
||||||
|
const verify = bool(core.getInput("verify"))
|
||||||
|
console.log(`Verify SVG | ${verify}`)
|
||||||
|
if (verify) {
|
||||||
|
const [libxmljs] = [await __webpack_require__.e(/* import() */ 344).then(__webpack_require__.t.bind(__webpack_require__, 53344, 3))].map(m => (m && m.default) ? m.default : m)
|
||||||
|
const parsed = libxmljs.parseXml(rendered)
|
||||||
|
if (parsed.errors.length)
|
||||||
|
throw new Error(`Malformed SVG : \n${parsed.errors.join("\n")}`)
|
||||||
|
console.log(`SVG valid | yes`)
|
||||||
|
}
|
||||||
|
|
||||||
//Commit to repository
|
//Commit to repository
|
||||||
const dryrun = bool(core.getInput("dryrun"))
|
const dryrun = bool(core.getInput("dryrun"))
|
||||||
if (dryrun)
|
if (dryrun)
|
||||||
@@ -94334,6 +94345,9 @@ module.exports = require("zlib");
|
|||||||
/******/ return module.exports;
|
/******/ return module.exports;
|
||||||
/******/ }
|
/******/ }
|
||||||
/******/
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__;
|
||||||
|
/******/
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/******/ /* webpack/runtime/compat get default export */
|
/******/ /* webpack/runtime/compat get default export */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
@@ -94347,6 +94361,29 @@ module.exports = require("zlib");
|
|||||||
/******/ };
|
/******/ };
|
||||||
/******/ })();
|
/******/ })();
|
||||||
/******/
|
/******/
|
||||||
|
/******/ /* webpack/runtime/create fake namespace object */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // create a fake namespace object
|
||||||
|
/******/ // mode & 1: value is a module id, require it
|
||||||
|
/******/ // mode & 2: merge all properties of value into the ns
|
||||||
|
/******/ // mode & 4: return value when already ns object
|
||||||
|
/******/ // mode & 8|1: behave like require
|
||||||
|
/******/ __webpack_require__.t = function(value, mode) {
|
||||||
|
/******/ if(mode & 1) value = this(value);
|
||||||
|
/******/ if(mode & 8) return value;
|
||||||
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||||
|
/******/ var ns = Object.create(null);
|
||||||
|
/******/ __webpack_require__.r(ns);
|
||||||
|
/******/ var def = {};
|
||||||
|
/******/ if(mode & 2 && typeof value == 'object' && value) {
|
||||||
|
/******/ for(const key in value) def[key] = () => value[key];
|
||||||
|
/******/ }
|
||||||
|
/******/ def['default'] = () => value;
|
||||||
|
/******/ __webpack_require__.d(ns, def);
|
||||||
|
/******/ return ns;
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
/******/ /* webpack/runtime/define property getters */
|
/******/ /* webpack/runtime/define property getters */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
/******/ // define getter functions for harmony exports
|
/******/ // define getter functions for harmony exports
|
||||||
@@ -94359,6 +94396,28 @@ module.exports = require("zlib");
|
|||||||
/******/ };
|
/******/ };
|
||||||
/******/ })();
|
/******/ })();
|
||||||
/******/
|
/******/
|
||||||
|
/******/ /* webpack/runtime/ensure chunk */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ __webpack_require__.f = {};
|
||||||
|
/******/ // This file contains only the entry chunk.
|
||||||
|
/******/ // The chunk loading function for additional chunks
|
||||||
|
/******/ __webpack_require__.e = (chunkId) => {
|
||||||
|
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
||||||
|
/******/ __webpack_require__.f[key](chunkId, promises);
|
||||||
|
/******/ return promises;
|
||||||
|
/******/ }, []));
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/get javascript chunk filename */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // This function allow to reference async chunks
|
||||||
|
/******/ __webpack_require__.u = (chunkId) => {
|
||||||
|
/******/ // return url for filenames based on template
|
||||||
|
/******/ return "" + chunkId + ".index.js";
|
||||||
|
/******/ };
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
|
/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
|
||||||
@@ -94377,7 +94436,45 @@ module.exports = require("zlib");
|
|||||||
/******/
|
/******/
|
||||||
/******/ /* webpack/runtime/compat */
|
/******/ /* webpack/runtime/compat */
|
||||||
/******/
|
/******/
|
||||||
/******/ __webpack_require__.ab = __dirname + "/";/************************************************************************/
|
/******/ __webpack_require__.ab = __dirname + "/";/* webpack/runtime/require chunk loading */
|
||||||
|
/******/ (() => {
|
||||||
|
/******/ // object to store loaded chunks
|
||||||
|
/******/ // "1" means "loaded", otherwise not loaded yet
|
||||||
|
/******/ var installedChunks = {
|
||||||
|
/******/ 179: 1
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ var installChunk = (chunk) => {
|
||||||
|
/******/ var moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime;
|
||||||
|
/******/ for(var moduleId in moreModules) {
|
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||||
|
/******/ }
|
||||||
|
/******/ }
|
||||||
|
/******/ if(runtime) runtime(__webpack_require__);
|
||||||
|
/******/ for(var i = 0; i < chunkIds.length; i++)
|
||||||
|
/******/ installedChunks[chunkIds[i]] = 1;
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // require() chunk loading for javascript
|
||||||
|
/******/ __webpack_require__.f.require = function(chunkId, promises) {
|
||||||
|
/******/
|
||||||
|
/******/ // "1" is the signal for "already loaded"
|
||||||
|
/******/ if(!installedChunks[chunkId]) {
|
||||||
|
/******/ if(true) { // all chunks have JS
|
||||||
|
/******/ installChunk(require("./" + __webpack_require__.u(chunkId)));
|
||||||
|
/******/ } else installedChunks[chunkId] = 1;
|
||||||
|
/******/ }
|
||||||
|
/******/ };
|
||||||
|
/******/
|
||||||
|
/******/ // no external install chunk
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/ })();
|
||||||
|
/******/
|
||||||
|
/************************************************************************/
|
||||||
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
||||||
/******/ // startup
|
/******/ // startup
|
||||||
/******/ // Load entry module and return exports
|
/******/ // Load entry module and return exports
|
||||||
|
|||||||
@@ -116,6 +116,17 @@
|
|||||||
const rendered = await metrics({login:user, q}, {graphql, rest, plugins, conf, die})
|
const rendered = await metrics({login:user, q}, {graphql, rest, plugins, conf, die})
|
||||||
console.log(`Render | complete`)
|
console.log(`Render | complete`)
|
||||||
|
|
||||||
|
//Verify svg
|
||||||
|
const verify = bool(core.getInput("verify"))
|
||||||
|
console.log(`Verify SVG | ${verify}`)
|
||||||
|
if (verify) {
|
||||||
|
const [libxmljs] = [await import("libxmljs")].map(m => (m && m.default) ? m.default : m)
|
||||||
|
const parsed = libxmljs.parseXml(rendered)
|
||||||
|
if (parsed.errors.length)
|
||||||
|
throw new Error(`Malformed SVG : \n${parsed.errors.join("\n")}`)
|
||||||
|
console.log(`SVG valid | yes`)
|
||||||
|
}
|
||||||
|
|
||||||
//Commit to repository
|
//Commit to repository
|
||||||
const dryrun = bool(core.getInput("dryrun"))
|
const dryrun = bool(core.getInput("dryrun"))
|
||||||
if (dryrun)
|
if (dryrun)
|
||||||
|
|||||||
Reference in New Issue
Block a user