Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update existing result on each check #5

Open
alexlafroscia opened this issue Nov 21, 2019 · 1 comment
Open

Update existing result on each check #5

alexlafroscia opened this issue Nov 21, 2019 · 1 comment

Comments

@alexlafroscia
Copy link

Currently, each time that the check is run, a new instance of the check is added to the PR results.

However, it would be really nice if instead of only creating checks, it was able to update the existing one.

The current behavior means that if the check fails, then you update the description of the PR to include the right details, the original failing check never actually goes away!

@alexlafroscia
Copy link
Author

All of this suggests that the desired behavior is how it should be working right now

// If there are any previously failed CH checks, set them to neutral
// since we want this check to override those.
const checkList = await api.checks.listForRef(repoInfo);
const { check_runs } = checkList.data;
const clubhouseChecks = check_runs.filter(r => jobNames.includes(r.name));
const completedChecks = clubhouseChecks.filter(r => r.status === 'completed');
for (let check of completedChecks) {
console.log(`Updating ${check.id} check to neutral status`);
await api.checks.update({
...repoInfo,
check_run_id: check.id,
conclusion: 'neutral'
});

but this is what I'm seeing on a PR right now

Screen Shot 2019-11-21 at 12 48 24 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant