Issue about the parameters 'per_page' and 'page' in the API #24371
-
When using some APIs to list the objects we want to view, such as “List repository tags”, “List commits on a pull request”, “List workflow runs for a repository”, etc., generally we can see the following two parameters are mentioned to be available to these APIs:
Accourding to my understanding, for example, I have 208 workflow runs in one of my repository, and I execute the API like as below:
When I execute the API on Postman, it can correctly display the runs in each page, just likes as I mentioned above. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi team, Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
Finally, I got the solution that using the double quotes (“”) to surround the API URL. The while loop can break as expected now. See the result here: https://github.com/TestWorkflowsRML/RunAPI_Bash/runs/1208532662?check_suite_focus=true#step:3:16 Thanks for the help from Ivan Zuzak. I think the examples on the docs about the API should be changed to add the double quotes to surround the API URLs. Otherwise this may mislead users, just like the problem I was facing.
Expected on the docs page:
|
Beta Was this translation helpful? Give feedback.
Finally, I got the solution that using the double quotes (“”) to surround the API URL.
See the shell script: https://github.com/TestWorkflowsRML/RunAPI_Bash/blob/4ee8c4de131d9ddb31f0021bcba4b6d1a90c48a3/src/list-repo-workflow-runs.yml
The while loop can break as expected now. See the result here: https://github.com/TestWorkflowsRML/RunAPI_Bash/runs/1208532662?check_suite_focus=true#step:3:16
Thanks for the help from Ivan Zuzak.
I think the examples on the docs about the API should be changed to add the double quotes to surround the API URLs. Otherwise this may mislead users, just like the problem I was facing.
Current on the docs page: