Workflows with optional "approval" jobs don't appear as successful in github or circleci

I’ve added extra steps to optionally deploy a branch build to our staging environment, but we don’t want this for every PR. Due to this, however, the PR visually remains in a “pending” build state with a yellow circle instead of a green check mark.

Is there some way I can achieve push-button deploys from the interface for branches without interfering with the visual feedback showing that a branch built successfully? Some way to mark the jobs as “optional” or something?

The issue also impacts the workflows view in circleci itself, with all of my workflow builds appearing as pending instead of successful.

6 Likes

Heya! A bit of a necrobump, but did you ever manage to resolve this issue?
I also have an optional deploy button in every PR commit, but I want the workflow to “succeed” if all tests pass.


Here is an example of a case where a succesful commit will never show as “succeeded” and instead always remains “pending” until you deploy (even if you don’t want to).

Did anyone find a way to make them optional to be required and passed? I happen to encounter similar needs. It’s pretty annoying to have PR pending in yellow dot, while there’s a green checkmark we can use

@reydi I’ve spoken with CircleCI customer support, but they basically said “it’s a feature, not a bug”.
For the time being, we’ve just accepted this situation; mostly yellow “pending” for our commits instead of green checks.

1 Like

It’s probably not a bug, but it’s a bit disingenuous to blanket label it as a feature when it’s clearly dependent on the use case. For us, we use approval steps to conditionally deploy changes to our dev/prod environments but it’s not something we always want to do and it’s irritating to not get the “green dot” in Github to indicate that tests have passed.

@pluk would triggering a new workflow with your deploy job in it resolve the problem? The first job in your deploy workflow could be an approval job job, so the deploy workflow and job will require manual approval to start.

If so, you can use the CircleCI v2 API to trigger a workflow. The above would all GitHub check to pass for the initial workflow and all jobs within it.

Let me know if you need help or if you have any additional questions.

@Henna is there a roadmap item to add this in the UI directly? Like a way to trigger a manual job for the given commit (just like it is possible on GitLab Pipelines).

Looks like finding a way to solve the jobs being on “pending” state on GitHub is one of the most upvoted feature requests on Canny: Show overall “All checks have passed” status in github even on builds with incomplete “type: approval” job | Cloud Feature Requests | CircleCI Ideas (canny.io)

Hi everyone,
While we wait for the official solution, I managed to find a workaround based on the GitHub Commit Status API. If you’re interested, I wrote an article about it :slight_smile: Solving GitHub Status stuck on Pending with CircleCI’s Approvals - Federico Terzi - A Software Engineering Journey

Finally got the green checks back!