Marcial Puchi
05/22/2025, 5:07 PMdismiss stale pull request GitHub action, to avoid having to re-approve sub-stacks after rebasing. However, every time we merge a base stack, and rebase the subsequent stacks, all previous approvals are dismissed by the GitHub action with the following message:
Latest workflow ID:
jq: invalid JSON text passed to --argjson
Use jq --help for help with command-line options,
or see the jq manpage, or online docs at https://jqlang.github.io/jq
Failed to parse GitHub response with jq:
(url: https://api.github.com/repos/repo/repo/actions/workflows//runs?status=success&branch=task/foo)
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest",
"status": "404"
}
Notice: No previous SHAs found; behaving as if diff has changedAfter some investigation I noticed 2 issues with the
latest_artifact.sh script:
1. The || in line 20 is not working as expected:
latest_workflow_id=$(echo ${workflows} \
| jq \
--arg workflow_name "$workflow_name" \
'.workflows[] | select(.name==$workflow_name).id' || echo "ERROR")
The jq command is returning an empty string, causing the || not to take effect. This results in latest_workflow_id to be an empty string and form a bad url in the following CURL request on line 36
The solution would be to have something like this instead:
maybe_latest_workflow_id=$(echo ${workflows} \
| jq \
--arg workflow_name "$workflow_name" \
'.workflows[] | select(.name==$workflow_name).id')
latest_workflow_id=${maybe_latest_workflow_id:-"ERROR"}
2. The 3rd argument expected by the latest_artifact.sh script is the PR number, which is extracted from echo graphite-base/12345 | cut -d '/' -f 1)
This however, will return the first part of the string, in this case graphite-base instead of the pr number. Instead the command should be echo graphite-base/12345 | cut -d '/' -f 2)
Let me know if I'm missing something, or if this is expected behavior
Thanks!Pylon
05/22/2025, 5:07 PMgt feedback --with-debug-context <any message>Marcial Puchi
05/28/2025, 6:19 PMper_page param in the Github get workflows api and make sure the desired workflow is in one of the next pages.
Let me know if you need anything else, or if it's better for me to fork the project and create the fix.
Thanks!Pylon
07/11/2025, 8:34 PM