Update readme and remove selfskip plugin (#18)

* Update readme and remove selfskip plugin

* Use relative links instead for images

* Private contributions
This commit is contained in:
Simon Lecoq
2020-12-12 12:19:20 +01:00
committed by GitHub
parent 1ef9cd3f6c
commit afb11b57f7
19 changed files with 638 additions and 532 deletions

View File

@@ -29,7 +29,6 @@
traffic:"Pages views",
lines:"Lines of code changed",
habits:"Coding habits",
selfskip:"Skip metrics commits",
music:"Music plugin",
posts:"Recent posts",
isocalendar:"Isometric commit calendar",

View File

@@ -11,7 +11,6 @@
import pagespeed from "./pagespeed/index.mjs"
import posts from "./posts/index.mjs"
import projects from "./projects/index.mjs"
import selfskip from "./selfskip/index.mjs"
import topics from "./topics/index.mjs"
import traffic from "./traffic/index.mjs"
@@ -27,7 +26,6 @@
pagespeed,
posts,
projects,
selfskip,
topics,
traffic,
}

View File

@@ -1,25 +0,0 @@
//Setup
export default async function ({login, rest, computed, q}, {enabled = false} = {}) {
//Plugin execution
try {
//Check if plugin is enabled and requirements are met
if ((!enabled)||(!q.selfskip))
return null
//Search for auto-generated commits
let commits = 0
for (let page = 0;;page++) {
const {data} = await rest.repos.listCommits({owner:login, repo:login, author:login, per_page:100, page})
commits += data.filter(({commit}) => /\[Skip GitHub Action\]/.test(commit.message)).length
if (!data.length)
break
}
//Results
computed.commits -= commits
return {commits}
}
//Handle errors
catch (error) {
console.debug(error)
throw {error:{message:`An error occured`}}
}
}