How to grant permission to run osascript from shell

Trying to run AppleScript is driving me up a wall, and the docs in the macos orb are not helpful at all, not even https://support.circleci.com/hc/en-us/articles/360057033612-Enabling-AppleScript-Support-on-macOS was any help.

The article says the bundle id will usually be com.apple.Terminal, but that makes no sense, we’re usually running osascript straight from shell scripts, not the Terminal app, unless I misunderstand and the Terminal is involved under the hood. And anyway I tried it and it doesn’t work.

What Bundle ID do I put if I have a job step invoking a maven build that executes /bin/sh -c cd ‘/Users/distiller/project/.’ && ‘/usr/bin/osascript’ script.applescript?

I also tried com.apple.sshd since in an issue from years ago someone was saying our shell commands all get run through sshd on the mac executor, but I’m not sure that’s true.

Please document this better, argh!

I guess really Apple deserves all of the blame and derision for not providing a good way to make nice DMGs via script. Ugh. I found out that some people have come up with ways to do it by manipulating DS_Store files directly, which would definitely be a better approach than AppleScript. Hopefully I’ll find a way to use that instead