Remove unused variable
This commit is contained in:
1 parent
1ab7211044
commit
047d8630e6
2 files changed
+5
-6
No files matched your search
Vendored
+4
-4
@@ -1,4 +1,4 @@
|
||||
module.exports=(()=>{var __webpack_modules__={76677:(e,t,r)=>{"use strict";r.r(t);var n=r(85622);var i=r.n(n);var a=r(60270);var o=r(3584);var s=r(32882);var l=r.n(s);var c=r(29483);var u=r.n(c);var d=r(2390);var p=r.n(d);(async function(){const[e,t,r,n,l]=[s,c,o,d,a].map(e=>e&&e.default?e.default:e);const u=(e,t=false)=>typeof e==="string"?/^(?:[Tt]rue|[Oo]n|[Yy]es)$/.test(e):t;try{console.log(`GitHub metrics as SVG image`);console.log(`========================================================`);console.log(`Version | 1.8.0`);process.on("unhandledRejection",e=>{throw e});if(t.context.eventName==="push"&&t.context.payload&&t.context.payload.head_commit){console.log(t.context.payload.head_commit.message);if(/\[Skip GitHub Action\]/.test(t.context.payload.head_commit.message)){console.log(`Skipped because [Skip GitHub Action] is in commit message`);process.exit(0)}}const n=`<svg xmlns="http://www.w3.org/2000/svg" width="480" height="\${485 + ((computed.plugins.lines||computed.plugins.traffic) ? 20 : 0) + (computed.plugins.pagespeed ? 130 : 0) + (computed.plugins.habits ? 70 : 0)}">
|
||||
module.exports=(()=>{var __webpack_modules__={76677:(e,t,r)=>{"use strict";r.r(t);var n=r(85622);var i=r.n(n);var a=r(60270);var o=r(3584);var s=r(32882);var l=r.n(s);var c=r(29483);var u=r.n(c);(async function(){const[e,t,r,n]=[s,c,o,a].map(e=>e&&e.default?e.default:e);const l=(e,t=false)=>typeof e==="string"?/^(?:[Tt]rue|[Oo]n|[Yy]es)$/.test(e):t;try{console.log(`GitHub metrics as SVG image`);console.log(`========================================================`);console.log(`Version | 1.8.0`);process.on("unhandledRejection",e=>{throw e});if(t.context.eventName==="push"&&t.context.payload&&t.context.payload.head_commit){console.log(t.context.payload.head_commit.message);if(/\[Skip GitHub Action\]/.test(t.context.payload.head_commit.message)){console.log(`Skipped because [Skip GitHub Action] is in commit message`);process.exit(0)}}const a=`<svg xmlns="http://www.w3.org/2000/svg" width="480" height="\${485 + ((computed.plugins.lines||computed.plugins.traffic) ? 20 : 0) + (computed.plugins.pagespeed ? 130 : 0) + (computed.plugins.habits ? 70 : 0)}">
|
||||
<style>
|
||||
\${style}
|
||||
</style>
|
||||
@@ -304,7 +304,7 @@ module.exports=(()=>{var __webpack_modules__={76677:(e,t,r)=>{"use strict";r.r(t
|
||||
|
||||
</div>
|
||||
</foreignObject>
|
||||
</svg>`,a=`/* SVG global context */
|
||||
</svg>`,o=`/* SVG global context */
|
||||
svg {
|
||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
||||
font-size: 14px;
|
||||
@@ -499,7 +499,7 @@ module.exports=(()=>{var __webpack_modules__={76677:(e,t,r)=>{"use strict";r.r(t
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}`,o=`query Metrics {
|
||||
}`,s=`query Metrics {
|
||||
user(login: \$login) {
|
||||
name
|
||||
login
|
||||
@@ -595,4 +595,4 @@ module.exports=(()=>{var __webpack_modules__={76677:(e,t,r)=>{"use strict";r.r(t
|
||||
}
|
||||
}
|
||||
}
|
||||
`;console.log(`Templates | loaded`);const s=e.getInput("token");console.log(`Github token | ${s?"provided":"missing"}`);if(!s)throw new Error("You must provide a valid GitHub token");const c=r.graphql.defaults({headers:{authorization:`token ${s}`}});console.log(`Github GraphQL API | ok`);const d=t.getOctokit(s);console.log(`Github REST API | ok`);const p=e.getInput("filename")||"github-metrics.svg";const m=i().join(p);console.log(`SVG output file | ${m}`);const f=u(e.getInput("optimize"),true);console.log(`SVG optimization | ${f}`);const h=e.getInput("user")||(await d.users.getAuthenticated()).data.login;console.log(`GitHub user | ${h}`);const g=u(e.getInput("debug"));if(!g)console.debug=(()=>null);console.log(`Debug mode | ${g}`);const y={lines:{enabled:u(e.getInput("plugin_lines"))},traffic:{enabled:u(e.getInput("plugin_traffic"))},pagespeed:{enabled:u(e.getInput("plugin_pagespeed"))},habits:{enabled:u(e.getInput("plugin_habits"))},selfskip:{enabled:u(e.getInput("plugin_selfskip"))}};const v=Object.fromEntries(Object.entries(y).filter(([e,t])=>t.enabled).map(([e])=>[e,true]));console.log(`Plugins enabled | ${Object.entries(y).filter(([e,t])=>t.enabled).map(([e])=>e).join(", ")}`);if(y.pagespeed.enabled){y.pagespeed.token=e.getInput("pagespeed_token");console.log(`Pagespeed token | ${y.pagespeed.token?"provided":"missing"}`)}const b=await l({login:h,q:v},{template:n,style:a,query:o,graphql:c,rest:d,plugins:y,optimize:f});console.log(`Render | complete`);{const r=e.getInput("committer_token")||e.getInput("token");console.log(`Committer token | ${r?"provided":"missing"}`);if(!r)throw new Error("You must provide a valid GitHub token");const n=t.getOctokit(r);console.log(`Committer REST API | ok`);console.log(`Committer | ${(await n.users.getAuthenticated()).data.login}`);let i=null;try{const{data:e}=await n.repos.getContent({owner:h,repo:h,path:p});i=e.sha}catch(e){}console.log(`Previous render sha | ${i||"none"}`);await n.repos.createOrUpdateFileContents({owner:h,repo:h,path:p,message:`Update ${p} - [Skip GitHub Action]`,content:Buffer.from(b).toString("base64"),...i?{sha:i}:{}});console.log(`Commit to repo | ok`)}console.log(`Success !`);process.exit(0)}catch(t){console.error(t);e.setFailed(t.message);process.exit(1)}})().catch(e=>process.exit(1))},12541:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const i=n(r(12087));const a=r(74332);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+i.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const o="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=o+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${o}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},32882:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const a=r(12541);const o=r(29582);const s=r(74332);const l=i(r(12087));const c=i(r(85622));var u;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(u=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=s.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){const t="_GitHubActionsFileCommandDelimeter_";const n=`${e}<<${t}${l.EOL}${r}${l.EOL}${t}`;o.issueCommand("ENV",n)}else{a.issueCommand("set-env",{name:e},r)}}t.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){o.issueCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${c.delimiter}${process.env["PATH"]}`}t.addPath=add
Line truncated
|
||||
`;console.log(`Templates | loaded`);const c=e.getInput("token");console.log(`Github token | ${c?"provided":"missing"}`);if(!c)throw new Error("You must provide a valid GitHub token");const u=r.graphql.defaults({headers:{authorization:`token ${c}`}});console.log(`Github GraphQL API | ok`);const d=t.getOctokit(c);console.log(`Github REST API | ok`);const p=e.getInput("filename")||"github-metrics.svg";const m=i().join(p);console.log(`SVG output file | ${m}`);const f=l(e.getInput("optimize"),true);console.log(`SVG optimization | ${f}`);const h=e.getInput("user")||(await d.users.getAuthenticated()).data.login;console.log(`GitHub user | ${h}`);const g=l(e.getInput("debug"));if(!g)console.debug=(()=>null);console.log(`Debug mode | ${g}`);const y={lines:{enabled:l(e.getInput("plugin_lines"))},traffic:{enabled:l(e.getInput("plugin_traffic"))},pagespeed:{enabled:l(e.getInput("plugin_pagespeed"))},habits:{enabled:l(e.getInput("plugin_habits"))},selfskip:{enabled:l(e.getInput("plugin_selfskip"))}};const v=Object.fromEntries(Object.entries(y).filter(([e,t])=>t.enabled).map(([e])=>[e,true]));console.log(`Plugins enabled | ${Object.entries(y).filter(([e,t])=>t.enabled).map(([e])=>e).join(", ")}`);if(y.pagespeed.enabled){y.pagespeed.token=e.getInput("pagespeed_token");console.log(`Pagespeed token | ${y.pagespeed.token?"provided":"missing"}`)}const b=await n({login:h,q:v},{template:a,style:o,query:s,graphql:u,rest:d,plugins:y,optimize:f});console.log(`Render | complete`);{const r=e.getInput("committer_token")||e.getInput("token");console.log(`Committer token | ${r?"provided":"missing"}`);if(!r)throw new Error("You must provide a valid GitHub token");const n=t.getOctokit(r);console.log(`Committer REST API | ok`);console.log(`Committer | ${(await n.users.getAuthenticated()).data.login}`);let i=null;try{const{data:e}=await n.repos.getContent({owner:h,repo:h,path:p});i=e.sha}catch(e){}console.log(`Previous render sha | ${i||"none"}`);await n.repos.createOrUpdateFileContents({owner:h,repo:h,path:p,message:`Update ${p} - [Skip GitHub Action]`,content:Buffer.from(b).toString("base64"),...i?{sha:i}:{}});console.log(`Commit to repo | ok`)}console.log(`Success !`);process.exit(0)}catch(t){console.error(t);e.setFailed(t.message);process.exit(1)}})().catch(e=>process.exit(1))},12541:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const i=n(r(12087));const a=r(74332);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+i.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const o="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=o+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${o}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},32882:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const a=r(12541);const o=r(29582);const s=r(74332);const l=i(r(12087));const c=i(r(85622));var u;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(u=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=s.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){const t="_GitHubActionsFileCommandDelimeter_";const n=`${e}<<${t}${l.EOL}${r}${l.EOL}${t}`;o.issueCommand("ENV",n)}else{a.issueCommand("set-env",{name:e},r)}}t.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){o.issueCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${c.delimiter}${process.env["PATH"]}`}t.addPath=add
Line truncated
|
||||
+1
-2
@@ -4,11 +4,10 @@
|
||||
import * as _octokit from "@octokit/graphql"
|
||||
import * as _core from "@actions/core"
|
||||
import * as _github from "@actions/github"
|
||||
import * as _axios from "axios"
|
||||
|
||||
;((async function () {
|
||||
//Hack because ES modules are not correctly transpiled with ncc
|
||||
const [core, github, octokit, axios, metrics] = [_core, _github, _octokit, _axios, _metrics].map(m => (m && m.default) ? m.default : m)
|
||||
const [core, github, octokit, metrics] = [_core, _github, _octokit, _metrics].map(m => (m && m.default) ? m.default : m)
|
||||
//Yaml boolean converter
|
||||
const bool = (value, defaulted = false) => typeof value === "string" ? /^(?:[Tt]rue|[Oo]n|[Yy]es)$/.test(value) : defaulted
|
||||
//Runner
|
||||
|
||||
Reference in new issue
Block a user