Bash.tv → GitHub → itch.io

← Home

Letting the Bash Bot Create GitHub Gists

Do the GitHub setup first. This guide adds the extra settings the bot needs to create and update gists (https://gist.github.com).


How to read the screenshots


Part 1: Add the Gists permission to your GitHub token

Without this permission, GitHub blocks the bot and shows the error “Resource not accessible by personal access token.”

  1. Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens. Direct link: https://github.com/settings/personal-access-tokens
  2. Click your Bash token, then click Edit.
  3. Under Permissions, click + Add permissions and choose Account.
  4. Find Gists and set it to Read and write.
  5. Click Update.

The token itself stays the same, so you don’t need to change anything in Bash for this part.

Permission (Account) Setting
Gists Read and write

Part 2: Add gist.github.com to the Bash key

Bash only sends your key to the addresses listed on it. Gists use their own address, so add it to the list.

  1. Open your space’s Settings → API keys, click the GitHub key, and open More options.
  2. Follow the numbers in the screenshot:

    Bash GitHub key with gist.github.com added as a third address

    1. Click + Add address.
    2. Type gist.github.com.
    3. Choose Username and password.
    4. Username: x-access-token
    5. Click Save. Don’t skip this step, or the change is lost.

When you’re done, the key should list three addresses:

Address Type Username
api.github.com Bearer token –
github.com Username and password x-access-token
gist.github.com Username and password x-access-token

Part 3: Ask the bot to check it

Gists are set up. Please check that you can create one.


What works, and one limit

What Works?
Create a gist (public or secret) ✅
Edit a gist’s text files ✅
Download (clone) a gist ✅
Upload images to a gist ❌ GitHub doesn’t allow fine-grained tokens to do this

Workaround for images: the bot uploads screenshots to a free image host (we use freeimage.host) and links them in the gist. It also keeps a copy in this repo under docs/images/.

Anything uploaded to an image host is public. Blur names, profile pictures, emails, and tokens first.


Troubleshooting

Problem Fix
“Resource not accessible by personal access token” Gists isn’t set to Read and write yet (Part 1).
“could not read Username for ‘https://gist.github.com’” gist.github.com isn’t on the Bash key, or you didn’t click Save (Part 2).
“Repository not found” when uploading images to a gist This is the GitHub limit above. Use the image host workaround.
Images in a gist are broken The images link to a private repo. Use image host links instead.

Quick checklist


← Previous · Home · Next: Push games to itch.io with butler →