I am trying to iterate through a list in a bash script but I keep getting a "Not Found"
#!/bin/bash
for repo in $(gh repo list eljoeyjojo --json name |jq '.[].name'); do
echo $repo
gh api repos/eljoeyjojo/$repo/contributors
done
Expected Result:
"diner-app"
username-1 5 contributions
username-2 2 contributions
"terraform-vault-core"
username-1 5 contributions
username-2 2 contributions
...............
...............
...............
Actual Result:
"diner-app"
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#list-repository-contributors"
}
gh: Not Found (HTTP 404)
"terraform-vault-core"
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#list-repository-contributors"
}
gh: Not Found (HTTP 404)
"whatever-repo"
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#list-repository-contributors"
}
gh: Not Found (HTTP 404)
"flask-hello-world"
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#list-repository-contributors"
}
gh: Not Found (HTTP 404)
If I use a a single variable in that for loop like $REPO1 it works fine but when it iterates in a loop it keep keeps giving me 404 errors.