In this guide

Update a Gist

Change a gist's description, or edit, rename, add and remove its files.

Action referenceChange

What this action does #

First, connect GitHub in Services. Then open Actions → + → GitHub and choose Update a Gist.

What a run does

Running or testing this action changes something in your connected service.

More about this action

Files carries every change, keyed by the file's *current* name:

• Replace the text — {"note.md": {"content": "New text"}}
• Rename it — {"note.md": {"filename": "todo.md"}}
• Remove it — {"note.md": null}
• Add one — use a name the gist does not have yet.

Files left out are untouched, so this appends nothing: content replaces the file whole. An action that adds a line has to read the gist first and send back the old text plus the new line.

Public cannot be changed here. A gist created secret stays secret.

Inputs to fill in #

Open an input to choose its value. Keep a fixed value with Text, receive it from Shortcuts, ask when the action runs, or use an Earlier Step. Read how input sources work.

Gist ID

RequiredText

The hash at the end of the gist's URL.

This input offers a picker for gist from your connected account. You can also supply its value directly.

Example value (replace with your own):
aa5a315d61ae9438b18d

Description

OptionalText

Replaces the gist's description. Shown as its title.

Files

OptionalStructured data (JSON)

Keyed by current file name. Null removes a file.

Example value (replace with your own):
{"note.md":{"content":"New text"}}

What comes back #

In the action editor, open Output → Returned Value to choose fields for your shortcut. These are the response fields described by the app; a service may omit an optional field or return an empty list. JSON File contains the full response.

Returned fieldTypeMeaning
idstringThe hash used in every other gist endpoint.
html_urlstringThe page to open or share.
descriptionstringShown as the gist's title. Null when unset.
publicbooleanFalse means unlisted, not private.
commentsintegerWhole-number value.
created_atstringISO 8601.
updated_atstringText value.
truncatedbooleanTrue when a file was too large to include whole.
ownerobjectA group of named values.
owner.loginstringUsername.
owner.idintegerWhole-number value.
owner.html_urlstringTheir profile page.
owner.avatar_urlstringText value.
owner.typestringUser, Organization or Bot.
filesobjectKeyed by file name, so the keys are yours and cannot be listed here. Each value has filename, type, language, size, raw_url and — unless truncated — content.

Run it from Shortcuts #

  1. Give the action a recognizable name and tap Save.
  2. In Apple Shortcuts, add Shortcutify’s Execute Action and select the saved action.
  3. Supply any Param or File slots you bound in the inputs, then run the shortcut.

If the result is unexpected, open Logs in Shortcutify, select the run, and inspect this step’s inputs and response.

Advanced reference #

Request, permissions, and identifiers

Request: PATCH https://api.github.com/gists/{gist_id}

Action identifier: github.gists.update.v1

Permissions declared for this action: gists:write. The account’s own access rules also apply.

InputRequest keyLocation
Gist IDgist_idpath
Descriptiondescriptionbody
Filesfilesbody

GitHub API reference