mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
41 lines
1 KiB
TypeScript
41 lines
1 KiB
TypeScript
|
import fs from 'fs/promises';
|
||
|
import path from 'path';
|
||
|
|
||
|
const token = process.env.TOKEN;
|
||
|
// TODO: migrate to ESM and import
|
||
|
const contributors = require('@dianmora/contributors');
|
||
|
const excludebots = [
|
||
|
'verdacciobot',
|
||
|
'dependabot-preview[bot]',
|
||
|
'dependabot[bot]',
|
||
|
'64b2b6d12bfe4baae7dad3d01',
|
||
|
'greenkeeper[bot]',
|
||
|
'snyk-bot',
|
||
|
'allcontributors[bot]',
|
||
|
'renovate[bot]',
|
||
|
'undefined',
|
||
|
'renovate-bot',
|
||
|
];
|
||
|
|
||
|
(async () => {
|
||
|
try {
|
||
|
// Awesome script made by https://github.com/dianmorales
|
||
|
const result = await contributors({
|
||
|
token: token,
|
||
|
organization: 'verdaccio',
|
||
|
excludebots,
|
||
|
allowFork: false,
|
||
|
allowPrivateRepo: false,
|
||
|
});
|
||
|
const pathContributorsFile = path.join(
|
||
|
__dirname,
|
||
|
'../packages/tools/docusaurus-plugin-contributors/src/contributors.json'
|
||
|
);
|
||
|
await fs.writeFile(pathContributorsFile, JSON.stringify(result, null, 4));
|
||
|
} catch (err) {
|
||
|
// eslint-disable-next-line no-console
|
||
|
console.error('error on update', err);
|
||
|
process.exit(1);
|
||
|
}
|
||
|
})();
|