Cannot index string with string "status"
FraserPol opened this issue · comments
Attempting to use the example repo and get the following error;
+ ROOT=./packages
+ REPOSITORY_TYPE=github
+ CIRCLE_API=https://circleci.com/api
+ LAST_COMPLETED_BUILD_URL='https://circleci.com/api/v1.1/project/github/hashicorp/instruqt-packer/tree/fp/move_file?filter=completed&limit=100&shallow=true'
++ curl -Ss -u : 'https://circleci.com/api/v1.1/project/github/hashicorp/instruqt-packer/tree/fp/move_file?filter=completed&limit=100&shallow=true'
++ jq -r 'map(select(.status == "success") | select(.workflows.workflow_name != "ci")) | .[0]["vcs_revision"]'
jq: error (at <stdin>:2): Cannot index string with string "status"
+ LAST_COMPLETED_BUILD_SHA=```
Could you try to request directly in the browser the LAST_COMPLETED_BUILD_URL
(attach as a query param &circle-token=<your-token>
) and output the result json? Might be that you specified a wrong key or have insuficient permissions.
I ran into the same error message. Basically the CIRCLE_TOKEN was not set and therefore the call was not authorized....
There should be a guard early in the script to validate that CIRCLE_TOKEN is set. This issue is 'closed' which makes it even harder to find on the repo and is a blocker for getting started.
Still getting the same issue after validating that the CIRCLE_TOKEN is set.
Just so that people in the future are looking at this the CIRCLE_TOKEN refers to the personal API key in CircleCi https://app.circleci.com/settings/user/tokens
@pmdebaets my man!