Is there an option to add a timeout to job approval?

I have a workflow with an approval job:

workflows:
    version: 2
    receptor:
        jobs:
            - build
            - wait_approval_deploy:
                 type: approval
                 requires:
                     - build
            - deploy:
                requires:
                    - build
                    - wait_approval_deploy

How can I set a timeout to this job that after X seconds the hold will be expired?
After this timeout, the workflow will not wait for approval anymore and the workflow will be canceled.

Thanks

Hi @eyalmeiron,

Thank you for sharing your question on our forum!

Currently there is no way to set a timeout for approval jobs. There is a limit of 90 days for jobs to be approved, and in the case that workspaces are used the limit is 15 days.

https://support.circleci.com/hc/en-us/articles/360043401212-Time-Limit-for-Approval-Hold-Job

One workaround would be to utilize our api to occasionally check the duration of approval jobs, and then cancel them if they exceeded a specific time. This would require you to create a custom script however.

You can find more information about our API endpoints on the following page:

https://circleci.com/docs/api/v2/#operation/approvePendingApprovalJobById

You are also more than welcome to create a feature request for this here as well:

Cloud Feature Requests | CircleCI Ideas

Best Regards

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.