Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid executing
contracts-docs-publish
parallelly
When `contracts-docs-publish` job is executed at a similar time for both Random Beacon and ECDSA, it may happen that both jobs pull the `auto-update-solidity-api-docs` branch at the same state and one of the jobs will push a commit with updated docs, while the other won't be able to do that, as the state of the branch will be different than when the pull happened. The error we see in that case is following: ``` error: failed to push some refs to 'https://github.com/threshold-network/threshold.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. ``` To avoid such situations we add a `contracts-docs-prepublish-wait` job to each workflow with a step that checks if any 'Publish contracts documentation' worklow is currently running. If it detects such job, it will wait specified time and check again. Only when no running job is detected, the steps will succeed and the workflow will proceed to execution of the `Publish contracts documentation` job. As it's likely that both `contracts-docs-prepublish-wait` jobs will be run at a similar time. we add a 10s wait in one of them, to avoid executing both at a moment when no `Publish contracts documentation` is run yet in any workflow. There is still a small change that both `Publish contracts documentation` jobs will run at similar time and cause a failure of one of them, but in that unlikely scenario, we can always rerun the failing job and it should pass on that second run.
- Loading branch information