Skip to content

Commit

Permalink
Merge pull request #264 from 18F/mgwalker/cleanup
Browse files Browse the repository at this point in the history
Clean up a bit
  • Loading branch information
mgwalker authored Sep 1, 2023
2 parents a75c1a1 + 93fa0e3 commit 3cb71fa
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/addFact.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const fs = require("fs").promises;
const path = require("path");
const { exec } = require("child_process");
const { Octokit } = require("@octokit/rest");

const exists = async (path) => {
Expand All @@ -25,19 +24,6 @@ const getFact = (rawFact) => {
return rawFact;
};

const cmd = (...cmd) =>
new Promise((resolve, reject) => {
console.log(...cmd);
exec(...cmd, (err, stdout) => {
if (err) {
reject(new Error(err));
} else {
console.log(stdout);
resolve();
}
});
});

(async () => {
const github = new Octokit({
auth: process.env.GITHUB_TOKEN,
Expand Down Expand Up @@ -87,28 +73,4 @@ const cmd = (...cmd) =>
await fs.writeFile(allFactsPath, JSON.stringify(allFacts, null, 2), {
encoding: "utf-8",
});

// const branch = `add-fact/${issueNumber}`;
// await cmd(`git config --local user.email "mgwalker@users.noreply.github.com"`);
// await cmd(`git config --local user.name "automatic update"`);
// await cmd(`git checkout -b ${branch}`);
// await cmd(`git add ${allFactsPath}`);
// await cmd(`git commit -m "automatically-added fact"`);
// await cmd(`git push origin ${branch}`);

// await github.rest.pulls.create({
// base: "main",
// body: `This fact is being added automatically from the contents of #${issueNumber}`,
// head: branch,
// owner,
// repo,
// title: `Adding fact for #${issueNumber}`,
// });

// await github.rest.issues.update({
// issue_number: issueNumber,
// owner,
// repo,
// state: "closed",
// });
})();

0 comments on commit 3cb71fa

Please sign in to comment.