Clicky

GitHub Actions + Shortcuts for iOS

I’ve been using the schedule event in GitHub Actions recently for a handful of projects. Unfortunately, the schedule event doesn’t provide strong service guarantees. According to GitHub:

Note: The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs. High load times include the start of every hour. To decrease the chance of delay, schedule your workflow to run at a different time of the hour.

While many workflow executions run almost exactly when scheduled, I’ve observed a wide range of performance. Delays of up to an hour are common, even when applying the suggestion mentioned above.

Others online have observed similar behavior (1, 2). The general suggestion for workloads with strict scheduling requirements has been to execute the Action manually via GitHub’s API using the workflow dispatch endpoint.

Although creating a cron job on a server to hit the endpoint is easy, needing to configure a server undermined the entire reason I picked GitHub Actions. Then I stumbled across a dead simple solution after remembering Shortcuts for iOS supports making HTTP requests.

a screenshot of the Shortcuts app in iOS with a 9:00PM daily automation which makes an HTTP request

Creating a GitHub Action cron in Shortcuts

  1. Ensure your GitHub Action supports the workflow_dispatch event
  2. Go to the Automation tab in Shortcuts
  3. Press + for a new automation and pick Personal Automation
  4. Choose Time of Day and select your schedule, then Next
  5. Select + Add Action then search for Get Contents of URL
  6. Configure the HTTP request per the GitHub API docs
  7. Done!

Security Note

Although this was a fun workaround I wouldn’t suggest storing secrets in Shortcuts permanently.

I’d love to see support added to Shortcuts for retrieving Keychain values, or even Bitwarden et al. adding similar functionality. Until then, one alternative I’ve seen is storing sensitive values in a remote file, retrieved at Shortcut runtime. Another option might be creating a Lambda for Shortcuts to invoke, which in turn makes the request to GitHub.

— Jon