One-Tap iOS Shortcut & Mobile Publishing Setup
One-Tap iOS Shortcut & Mobile Publishing Setup
This guide walks you through setting up single-tap mobile publishing for benunsworth.co.uk on iPhone, iPad, or Mac.
Once configured, tapping an icon on your Home Screen, pressing the iPhone Action Button, or tapping a Control Center tile triggers the GitHub Actions workflow to pull your Ready to Publish posts from Notion, optimise images, and publish them live to your site in around 60 seconds.
1. System Architecture
+-------------------------------------------------------------+
| 1. DRAFT IN NOTION (iPhone / iPad / Mac) |
| - Write post using Digital Garden properties |
| - Embed photos directly from camera roll |
| - Change 'Publish State' to "Ready to Publish" |
+------------------------------+------------------------------+
|
v
+-------------------------------------------------------------+
| 2. ONE-TAP TRIGGER |
| - Action Button / Home Screen / Control Center / Siri |
| - iOS Shortcut sends authenticated POST to GitHub API |
+------------------------------+------------------------------+
|
v
+-------------------------------------------------------------+
| 3. GITHUB ACTIONS (notion-publish.yml) |
| - Downloads posts marked "Ready to Publish" |
| - Resizes & optimizes photos into public/images/posts/ |
| - Creates _posts/YYYY-MM-DD-slug.md |
| - Updates Notion status to "Published" + live URL |
| - Pushes commit to main -> GitHub Pages builds & deploys |
+-------------------------------------------------------------+
2. Generate a Fine-Grained Personal Access Token (PAT)
The iOS Shortcut needs an authenticated token to trigger your GitHub Actions workflow via the GitHub REST API. Using a Fine-grained Personal Access Token ensures the token is locked to this single repository with the absolute minimum permissions needed.
- In your browser, go to GitHub Token Settings (or navigate to Settings > Developer Settings > Personal access tokens > Fine-grained tokens).
- Click Generate new token.
- Configure the token details:
- Token name:
iOS Shortcut - Garden Publisher - Expiration: Choose your preferred duration (e.g.
90 days,180 days, or1 year— set a calendar reminder to regenerate). - Resource owner: Select your personal account (
benunsworth). - Repository access: Choose Only select repositories > select
benunsworth/benunsworth.github.io. - Permissions: Under Repository permissions, find Actions and select Access: Read and write. (All other permissions should remain “No access”).
- Token name:
- Click Generate token.
- Copy the generated token (
github_pat_...) and store it safely in your password manager or iOS Notes. (GitHub will not show it again).
[!NOTE] Least Privilege Security: The fine-grained token only needs
Actions: Read and write. It does not need repositoryContents: Read and writeaccess because the workflow itself runs on GitHub with its own scoped credentials to commit posts tomain.
3. Configure the iOS Shortcut
You can configure the Shortcut in under three minutes using Apple’s built-in Shortcuts app on iOS, iPadOS, or macOS.
Step-by-Step Action Configuration
- Open the Shortcuts app on your iPhone or iPad.
- Tap + in the top right to create a new shortcut.
- Tap the shortcut title at the top, select Rename, and name it:
Publish Garden - Tap the icon next to the title to customize it:
- Colour: Terracotta / Orange
- Glyph: Sprout / Leaf or Rocket
- Add the following actions in sequence:
Action 1: Define Your Token (Text)
- Search for and add the Text action.
- Paste your fine-grained token (
github_pat_...) into the text box.
Action 2: Get Contents of URL (HTTP POST)
- Search for and add the Get Contents of URL action.
- Set the URL to:
https://api.github.com/repos/benunsworth/benunsworth.github.io/actions/workflows/notion-publish.yml/dispatches - Tap the expand arrow (
>) on the action to reveal request options:- Method:
POST - Headers: Add three headers:
| Key | Value |
| :— | :— |
|
Accept|application/vnd.github+json| |Authorization|Bearer(insert the Text variable from Action 1 right afterBearer) | |X-GitHub-Api-Version|2022-11-28| - Request Body: Select JSON
- Tap Add new field > choose Text:
- Key:
ref - Value:
main
- Key:
- Method:
Action 3: Notify Success
- Search for and add the Show Notification action:
- Set the message to:
Publishing garden post from Notion... Live in ~60 seconds. - Optional title:
Garden Publisher
- Set the message to:
Action 4: (Optional) Haptic Feedback
- Search for and add the Vibrate Device action for subtle tactile confirmation when tapped.
Shortcut Summary View
When complete, your Shortcut should match this layout:
[Text]
github_pat_11A...
[Get contents of https://api.github.com/repos/benunsworth/benunsworth.github.io/actions/workflows/notion-publish.yml/dispatches]
Method: POST
Headers:
Accept: application/vnd.github+json
Authorization: Bearer [Text]
X-GitHub-Api-Version: 2022-11-28
Request Body: JSON
ref: main
[Show Notification]
"Publishing garden post from Notion... Live in ~60 seconds."
[Vibrate Device]
4. Mobile Hardware & System Triggers
Once your shortcut is created, set up single-tap access wherever it is most convenient:
Option A: iPhone Action Button (iPhone 15 Pro / 16 / 16 Pro)
- Go to iPhone Settings > Action Button.
- Swipe across to select Shortcut.
- Tap the selection menu and choose Publish Garden.
- Now, pressing and holding the Action Button immediately fires the publishing workflow.
Option B: Home Screen Icon
- In the Shortcuts app, long-press or tap
...on Publish Garden. - Tap the Share sheet button (or the
iDetails inspector). - Tap Add to Home Screen.
- Choose an icon photo or glyph and tap Add.
- Place the icon beside your Notion app on your Home Screen.
Option C: iOS 18 Control Center Tile
- Swipe down from the top-right corner to open Control Center.
- Press and hold in an empty space to enter edit mode, then tap + Add a Control at the bottom.
- Search for Shortcut and add the 1×1 tile.
- Tap the tile to assign Publish Garden.
Option D: Siri Voice Trigger
Because the shortcut is named Publish Garden, you can activate it hands-free at any time:
“Hey Siri, Publish Garden”
Option E: Back Tap (Accessibility)
- Go to Settings > Accessibility > Touch > Back Tap.
- Select Double Tap or Triple Tap.
- Scroll down to the Shortcuts section and select Publish Garden.
5. Alternative: Zero-PAT Trigger via GitHub Mobile
If you prefer not to manage a Personal Access Token, you can trigger the publishing workflow directly from the official GitHub Mobile app on iOS using your standard biometric login (Face ID / Touch ID):
- Install the official GitHub app from the iOS App Store and sign in.
- In GitHub Mobile, navigate to your repository:
benunsworth/benunsworth.github.io. - Tap Actions in the repository tabs.
- Tap Publish from Notion.
- Tap the overflow menu (
...) or the blue Run workflow button. - Leave the branch as
mainand tap Run workflow.
6. Testing & Verification
Test via Terminal (cURL)
Before running the shortcut on your phone, you can verify your token and endpoint using this cURL command in your terminal:
curl -i -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer YOUR_GITHUB_PAT" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/benunsworth/benunsworth.github.io/actions/workflows/notion-publish.yml/dispatches \
-d '{"ref":"main"}'
Expected Response:
HTTP/2 204 No Content
A 204 No Content response indicates GitHub accepted the dispatch event and has queued the workflow.
End-to-End Test Workflow
- Open your Notion blog database.
- Create a test note (e.g.
Type: note,Status: rough,Title: Mobile Publishing Test). - Set
Publish Stateto Ready to Publish. - Trigger your Publish Garden shortcut (or run the cURL command).
- Watch your phone notification appear.
- Visit
https://github.com/benunsworth/benunsworth.github.io/actionsto see the Publish from Notion workflow run. - Within ~60 seconds, check benunsworth.co.uk to see your new post live!
7. Troubleshooting & Status Codes
| HTTP Status Code | Meaning | What to Check |
|---|---|---|
204 No Content |
Success | Workflow triggered and queued. Check GitHub Actions tab for progress. |
401 Unauthorized |
Invalid Token | The PAT is mistyped, expired, or revoked. Check the Authorization: Bearer <TOKEN> header. |
403 Forbidden |
Insufficient Scope | The PAT lacks permissions. Ensure Actions: Read and write is granted for benunsworth/benunsworth.github.io. |
404 Not Found |
Resource Not Found | Check for typos in the URL. Ensure the workflow file is committed to main at .github/workflows/notion-publish.yml. |
422 Unprocessable |
Invalid Payload | Ensure request body is JSON and contains {"ref": "main"}. |