-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
31 lines (28 loc) · 940 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const _ = require('axios');
const __ = require('simple-git');
const ___ = __();
async function ____() {
const _____ = await _.get('http://whatthecommit.com/index.txt');
const ______ = await _.get(`https://api.github.com/users/${process.env.GITHUB_ACTOR}/events`);
let _______;
let ________;
await ______.data.forEach((data) => {
if (data.type === 'PushEvent') {
_______ = data.payload.commits[0].author.email;
} else {
________ = 'github-actions[bot]';
_______ = '41898282+github-actions[bot]@users.noreply.github.com';
}
});
let _________ = ________ ? ________ : process.env.GITHUB_ACTOR;
await ___.addConfig('user.name', _________);
await ___.addConfig('user.email', _______);
await ___.commit(_____.data.replace(/(\r\n|\n|\r)/gm, ''), ['--amend']);
await ___.pull(['--allow-unrelated-histories']);
await ___.push();
}
try {
____();
} catch (error) {
throw new Error(error);
}