fix: add error handling code
This commit is contained in:
@@ -10,7 +10,7 @@ import History from './lib/history.mjs';
|
||||
// load env vars from .env file
|
||||
dotenv.config();
|
||||
|
||||
export default async function() {
|
||||
async function ghActionBot() {
|
||||
// parse repo name from cli and create repo instance
|
||||
const repo = createRepo(process.argv.splice(2)[0]);
|
||||
const {
|
||||
@@ -64,19 +64,11 @@ export default async function() {
|
||||
await deleteComment(repo, comment.id);
|
||||
})
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
TODO:
|
||||
|
||||
- [x] keep track of seen comment ids, only process new ones
|
||||
- [x] check the pr's status and only retest if no longer "Pending"
|
||||
- [x] add a retest comment
|
||||
- POST /repos/:owner/:repo/issues/:number/comments
|
||||
- [x] delete the retest comment
|
||||
- [ ] delete the build comment
|
||||
- [ ] delete ALL build failure comments
|
||||
- DELETE /repos/:owner/:repo/issues/comments/:comment_id
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
export default function() {
|
||||
return ghActionBot().catch(err => {
|
||||
console.error(err);
|
||||
return process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user