How can I run Heroku CLI commands from the Heroku Scheduler one-off dyno?
The CLI can be installed with the CLI buildpack and you'll need to set a valid API key on your application to run any application specific commands.
Here are the steps you can follow:
You can generate a key by using
heroku authorizations:createon a machine that is currently running an authenticated version of the Heroku CLI and set that key as a config variable
HEROKU_API_KEYfor your application.
Add the buildpack to your app:
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-cli.
These steps should help you run Heroku CLI commands from one-off dynos which the Heroku Scheduler add-on as well runs on.