2020-06-11 08:00:06 +02:00
|
|
|
const { GitHub, context } = require("@actions/github");
|
2020-06-11 07:50:40 +02:00
|
|
|
|
|
|
|
(async () => {
|
|
|
|
const core = require("@actions/core");
|
|
|
|
const exec = require("@actions/exec");
|
|
|
|
|
2020-06-11 08:02:20 +02:00
|
|
|
console.log('woaaah')
|
2020-06-11 08:05:32 +02:00
|
|
|
console.log("context", JSON.stringify(context.payload.commits));
|
2020-06-11 07:54:27 +02:00
|
|
|
|
2020-06-11 08:02:20 +02:00
|
|
|
console.log('CEOOO KONTEKAST')
|
|
|
|
console.log("context", JSON.stringify(context));
|
|
|
|
|
2020-06-11 07:54:27 +02:00
|
|
|
return;
|
2020-06-11 07:50:40 +02:00
|
|
|
// 1. Extract a list of users from received commits.
|
2020-06-11 08:00:06 +02:00
|
|
|
/* const token = process.env.GH_TOKEN;
|
2020-06-11 07:50:40 +02:00
|
|
|
|
|
|
|
const client = new GitHub(token, {});
|
2020-06-11 07:54:27 +02:00
|
|
|
const result = await client.({
|
2020-06-11 07:50:40 +02:00
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
commit_sha: context.sha,
|
|
|
|
});
|
|
|
|
|
|
|
|
const pr = result.data.length > 0 && result.data[0];
|
|
|
|
|
|
|
|
core.setOutput('pr', pr && pr.number || '');
|
|
|
|
core.setOutput('number', pr && pr.number || '');
|
|
|
|
core.setOutput('title', pr && pr.title || '');
|
|
|
|
core.setOutput('body', pr && pr.body || '');
|
|
|
|
|
|
|
|
|
|
|
|
// 2. Add them to the list.
|
|
|
|
const contreebutors = new Contreebutors();
|
|
|
|
|
|
|
|
for (let i = 0; i < users.length; i++) {
|
|
|
|
let user = users[i];
|
|
|
|
await contreebutors.add(user);
|
2020-06-11 07:54:27 +02:00
|
|
|
}*/
|
2020-06-11 07:50:40 +02:00
|
|
|
|
|
|
|
// 3. Commit changes done on the `contreebutors.json` and `README.md` file.
|
|
|
|
|
|
|
|
// 4. Add comment to the merged PR - notify the user that he was added to the contributors list.
|
|
|
|
})();
|