Fix potential error for repos with more than 30 workflows #139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I raised #135 a long time ago, but went down completely the wrong path when trying to diagnose the issue.
It turns out the issue is in
octokit.actions.listRepoWorkflows
, backed by the list repository workflows API call. Upon reading this documentation, you see that the defaultper_page
value is 30.So, for repos with more than 30 workflows, there is a chance that the call would not return the desired workflow, and the error
Unable to locate this workflow's ID in this repository, can't trigger job..
would occur.This PR uses the
total_count
value to see if a subsequent call needs to be made, and will do this until all pages are exhausted. This has been tested in https://github.com/neo4j/graphql and the error no longer occurs.Additionally, the project was not building due to
Error: error:0308010C:digital envelope routines::unsupported
. This is due to a deprecated version ofncc
. This has been removed and replaced with@vercel/ncc
so that the project can build once again.I think this project has great promise, I hope we can get this fix merged and a new version released!