mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-26 17:40:27 +01:00
Add master branch
This commit is contained in:
@@ -2,7 +2,6 @@ import {getDailyStats, getMonthlyStats, getTotalStats, getWeeklyStats} from "App
|
|||||||
import Redis from "@ioc:Adonis/Addons/Redis";
|
import Redis from "@ioc:Adonis/Addons/Redis";
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import Env from "@ioc:Adonis/Core/Env";
|
import Env from "@ioc:Adonis/Core/Env";
|
||||||
import Logger from "@ioc:Adonis/Core/Logger";
|
|
||||||
|
|
||||||
export async function UpdateGitHubReadme(): Promise<void> {
|
export async function UpdateGitHubReadme(): Promise<void> {
|
||||||
const daily_stats = await getDailyStats()
|
const daily_stats = await getDailyStats()
|
||||||
@@ -55,20 +54,18 @@ export async function UpdateGitHubReadme(): Promise<void> {
|
|||||||
let new_content = content.replace(old_stats_table, stats_table);
|
let new_content = content.replace(old_stats_table, stats_table);
|
||||||
new_content = new_content.replace(old_infos_table, infos_table)
|
new_content = new_content.replace(old_infos_table, infos_table)
|
||||||
|
|
||||||
await axios.put('https://api.github.com/repos/ArthurDanjou/ArthurDanjou/contents/README.md?ref=master', {
|
await axios.put('https://api.github.com/repos/ArthurDanjou/ArthurDanjou/contents/README.md', {
|
||||||
headers: {
|
headers: {
|
||||||
authorization: `Bearer ${Env.get('GITHUB_TOKEN')}`
|
authorization: `Bearer ${Env.get('GITHUB_TOKEN')}`
|
||||||
},
|
},
|
||||||
json: {
|
json: {
|
||||||
message: 'Updating recent statistics & informations',
|
message: 'Updating recent statistics & informations',
|
||||||
content: Buffer.from(new_content, 'utf8').toString('base64'),
|
content: Buffer.from(new_content, 'utf-8').toString('base64'),
|
||||||
sha: read_me.sha,
|
sha: read_me.sha,
|
||||||
author: {
|
author: {
|
||||||
name: 'api.arthurdanjou.fr - API Automation',
|
name: 'api.arthurdanjou.fr - API Automation',
|
||||||
email: 'me@arthurdanjou.fr'
|
email: 'me@arthurdanjou.fr'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
|
||||||
Logger.fatal(error)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user