1
0
Fork 0
mirror of https://github.com/veggiemonk/awesome-docker.git synced 2025-04-26 10:43:35 +02:00

Gh actions (#662)

* GitHub Actions
This commit is contained in:
Julien Bisconti 2019-01-25 22:26:52 +01:00 committed by GitHub
parent 82d9ebe503
commit cf38d3e8b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 56 deletions

View file

@ -17,11 +17,13 @@ const handleFailure = err => {
process.on('unhandledRejection', handleFailure);
if (!process.env.TOKEN) {
if (!process.env.GITHUB_TOKEN) {
LOG.error('no credentials found.');
process.exit(1);
}
const TOKEN = process.env.GITHUB_TOKEN
// --- ENV VAR ---
const BATCH_SIZE = parseInt(process.env.BATCH_SIZE, 10) || 10;
const DELAY = parseInt(process.env.DELAY, 10) || 3000;
@ -35,6 +37,7 @@ const DATE = dayjs().format('YYYY-MM-DDTHH.mm.ss');
const GITHUB_METADATA_FILE = `${DATA_FOLDER}/${DATE}-fetched_repo_data.json`;
const LATEST_FILENAME = `${DATA_FOLDER}/latest`;
const GITHUB_REPOS = `${DATA_FOLDER}/repository.json`;
const Authorization = `token ${TOKEN}`
// --- HTTP ---
const API = 'https://api.github.com/';
@ -43,7 +46,7 @@ const options = {
headers: {
'User-Agent': 'awesome-docker script listing',
'Content-Type': 'application/json',
Authorization: `token ${process.env.TOKEN}`,
Authorization,
},
};