ok.sh: upload_asset error with organization

Hi,

I’m having a problem using the upload_asset command with a github organization.

Here is the output of -vvv: https://hastebin.com/iquqitoqep And this is the tail end of -vvv -j: https://hastebin.com/itutoribat The first one has been edited heavily to remove the zip binary and ssl data, just for ease of reading. Second one is just the end, mostly so you can see this:

/home/folk/.local/bin/ok.sh: 1561: local: "url":: bad variable name

Here is the relevant line from my lua script: oksh("-vvv", "-j", "upload_asset", userId, repo, id, zip, "filename=" .. zip, "mime_type=application/zip") userId = stellaris-mods repo = test for the first paste, testing on the short 2nd paste zip = folk_testmod.zip

My head is fried at the moment, hopefully I can take a closer look soon, and come back with some more information.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

That’s a lot more readable and sane in Lua than sh 😀. Cool idea to use the path string from the docs. Very much inline with GH’s “URI templates” approach and I’ve wondered why that hasn’t seemed to catch on elsewhere. Thanks for the reply 👍.

Ok, I can reproduce it now. The response headers are getting output along with the JSON response body. Still digging into why only in this method and not elsewhere.

Here - just for reference - is formatted json from a different debug run than the above comment. The only difference is that the uploaded file name contains a underscore (“_”) - “folk_testmod.zip”, but in the above comment it’s “folktestmod.zip”:

{
	"url": "https://api.github.com/repos/stellaris-mods/testing/releases/7806517",
	"assets_url": "https://api.github.com/repos/stellaris-mods/testing/releases/7806517/assets",
	"upload_url": "https://uploads.github.com/repos/stellaris-mods/testing/releases/7806517/assets?name=folk_testmod.zip",
	"html_url": "https://github.com/stellaris-mods/testing/releases/tag/20170919-r2",
	"id": 7806517,
	"tag_name": "20170919-r2",
	"target_commitish": "master",
	"name": null,
	"draft": false,
	"author": {
		"login": "folknor",
		"id": 233791,
		"avatar_url": "https://avatars2.githubusercontent.com/u/233791?v=4",
		"gravatar_id": "",
		"url": "https://api.github.com/users/folknor",
		"html_url": "https://github.com/folknor",
		"followers_url": "https://api.github.com/users/folknor/followers",
		"following_url": "https://api.github.com/users/folknor/following{/other_user}",
		"gists_url": "https://api.github.com/users/folknor/gists{/gist_id}",
		"starred_url": "https://api.github.com/users/folknor/starred{/owner}{/repo}",
		"subscriptions_url": "https://api.github.com/users/folknor/subscriptions",
		"organizations_url": "https://api.github.com/users/folknor/orgs",
		"repos_url": "https://api.github.com/users/folknor/repos",
		"events_url": "https://api.github.com/users/folknor/events{/privacy}",
		"received_events_url": "https://api.github.com/users/folknor/received_events",
		"type": "User",
		"site_admin": false
	},
	"prerelease": false,
	"created_at": "2017-09-19T11:52:53Z",
	"published_at": "2017-09-19T11:53:03Z",
	"assets": [],
	"tarball_url": "https://api.github.com/repos/stellaris-mods/testing/tarball/20170919-r2",
	"zipball_url": "https://api.github.com/repos/stellaris-mods/testing/zipball/20170919-r2",
	"body": "* Updated readme.md with changes from steam.bbcode.\n* Steam.bbcode update."
}

Yeah I have no clue, please help.