2

I want to create an issue for an org repo using enterprise GitHub API, but unable to do that with curl

I am using

curl -u $username -d '{"title":"Big Files List", "label":"big files","body": "'$(find  -type f -size +150M)'"}'    https://$hostname/api/v3/repos/orgs/$orgName/$repoName/issues -k

The message in the response I got back was "Not Found"

I've checked https://developer.github.com/v3/issues/#create-an-issue, which only talks about user's repo instead of organization repo.

1 Answers1

0

Considering an organization repository is a Git repo following the same URL structure as any other repos, you can still follow GitHub API V3 issue "create an issue"

curl -k -u $username \
     -d '{"title":"Big Files List", "label":"big files","body": "'$(find  -type f -size +150M)'"}' \
     https://$hostname/api/v3/repos/$orgName/$repoName/issues
                             ^^^^^^^^^^^^^^^
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But now it gives me another error which is not directly related to the original issue. It says "body" is not an object. Probably the expression of `$(find -type f -size +150M)` is not expanded correctly within the command. Do you have any ideas? –  Dec 24 '18 at 19:35
  • Check if using double quotes instead of simple helps. It depends on the shell used. – VonC Dec 24 '18 at 20:01
  • it works fine when I replace `'$(find -type f -size +150M)'` with a string, so I must work around this part to solve the issue. The double/single quotes anywhere else work. –  Dec 24 '18 at 20:05