feat: Separate github and gitlab scripts (#526)

* feat: Add updateGitlab.js

* feat: Add updateGithub.js

* Remove stars action

* Remove @actions/core

* Add injectors

* Fix matching repo URLs

* Format

* Simplify injectData

* Add shared chunk.js file
This commit is contained in:
Lachlan Collins
2023-12-18 17:44:20 +11:00
committed by GitHub
parent 2054e0b26f
commit ea37aa2395
16 changed files with 709 additions and 786 deletions

15
scripts/chunk.js Normal file
View File

@@ -0,0 +1,15 @@
/**
* Divide an array into multiple smaller array
* @param {Array} input
* @param {number} size
* @return {Array<Array>}
*/
export function chunk(input, size) {
size = size < 1 ? 10 : size;
const pages = Math.ceil(input.length / size);
const final = [];
for (let index = 0; index < pages; index++) {
final.push(input.slice(index * size, (index + 1) * size));
}
return final;
}