github-pages-gitops

Read and modify GitHub repository config.json via the Contents API with SHA handling.

1|Updated Apr 10, 2026
Ready to run
npx skills add https://github.com/Junghyun99/MagicSplit --skill github-pages-gitops
๐Ÿ’ฌ Prompt for ChatGPT / Claude Chatโ–ผ
Please help me install this Agent Skill.
Skill: github-pages-gitops
Source: https://github.com/Junghyun99/MagicSplit/tree/main/.claude/skills/github-pages-gitops
Command: npx skills add https://github.com/Junghyun99/MagicSplit --skill github-pages-gitops

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GitHub Pages + GitHub API ์ปค๋ฐ‹ ๊ธฐ๋ฐ˜ ์„ค์ • ๋ณ€๊ฒฝ ํŒจํ„ด์„ ๊ตฌํ˜„ํ•œ๋‹ค. MagicSplit์˜ docs/ ์›น UI์— ์ƒˆ ํ•„๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜, config-editor ํŽ˜์ด์ง€๋ฅผ ์ฒ˜์Œ ๊ตฌ์„ฑํ•˜๊ฑฐ๋‚˜, config.json์˜ ์ƒˆ ํŒŒ๋ผ๋ฏธํ„ฐ์™€ HTML ํผ์„ ์—ฐ๋™ํ•˜๊ฑฐ๋‚˜, GitHub API 409 Conflict / SHA ๋ถˆ์ผ์น˜ ์˜ค๋ฅ˜๋ฅผ ๋””๋ฒ„๊น…ํ•  ๋•Œ ๋ฐ˜๋“œ์‹œ ์ด ์Šคํ‚ฌ์„ ์‚ฌ์šฉํ•œ๋‹ค. docs/ ํด๋”์˜ JavaScript๊ฐ€ config.json์„ ์ฝ๊ณ  ์“ฐ๋Š” ๋ชจ๋“  ์ž‘์—…์˜ ๊ธฐ์ค€์ด๋‹ค.

Core Features & Use Cases

  • GitHub Contents API๋ฅผ ํ†ตํ•œ GET/PUT ํ๋ฆ„์œผ๋กœ config.json์„ ์•ˆ์ „ํ•˜๊ฒŒ ํŽธ์ง‘ํ•˜๊ณ  ์ปค๋ฐ‹ํ•ฉ๋‹ˆ๋‹ค.
  • SHA ๊ฒ€์ฆ(SHA-locked) ์ „๋žต์œผ๋กœ 409 Conflict๋ฅผ ํ”ผํ•˜๊ณ  ์—ฐ์† ์ €์žฅ ์‹œ ์•ˆ์ •์ ์œผ๋กœ ์—…๋ฐ์ดํŠธ๋ฅผ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค.
  • Base64 ์ธ์ฝ”๋”ฉ/๋””์ฝ”๋”ฉ๊ณผ UTF-8 ํ•œ๊ธ€ ์ฒ˜๋ฆฌ์™€ ๊ด€๋ จ๋œ ๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜์„ฑ ๊ฐ€์ด๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  • docs UI์™€ config-editor ํŽ˜์ด์ง€ ๊ฐ„์˜ ์—ฐ๋™, ์ƒˆ๋กœ์šด ํŒŒ๋ผ๋ฏธํ„ฐ ์ถ”๊ฐ€ ๋ฐ ํผ ํ•„๋“œ ๋งคํ•‘์— ๋Œ€ํ•œ ์‹ค๋ฌด ํŒจํ„ด์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  • PAT ๋ณด์•ˆ ์šด์˜, ๋กœ์ปฌ ์ €์žฅ์†Œ ํ™œ์šฉ, ์—๋Ÿฌ ํ•ธ๋“ค๋ง ๋ฐ ์›Œํฌํ”Œ๋กœ์šฐ ์ •ํ•ฉ์„ฑ ํ™•๋ณด๋ฅผ ์œ„ํ•œ ๊ตฌํ˜„ ๊ฐ€์ด๋“œ๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

Quick Start

Use this skill to wire the docs UI to config.json via the GitHub Contents API and ensure commits include the current SHA.

Frequently Asked Questions about github-pages-gitops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update config.json on GitHub Pages using the Contents API without getting a 409 Conflict?โ–ผ

To update config.json via the GitHub Contents API without a 409 Conflict, you must fetch the current file SHA and include it in your PUT request payload. This SHA-locked strategy ensures safe, commit-based updates by validating that the file has not changed since you last read it.

Why does my GitHub Contents API save fail with a SHA mismatch error?โ–ผ

A SHA mismatch error occurs during a GitHub Contents API save when the SHA in your request does not match the latest commit SHA on the server. You must re-fetch the config.json file to obtain the updated SHA before retrying your commit-based update.

How do I handle Base64 encoding and decoding for UTF-8 Korean text in a browser config editor?โ–ผ

Handling Base64 encoding and decoding for UTF-8 Korean text in a browser config editor requires safely converting strings to byte arrays before encoding. This ensures GitHub Contents API receives valid Base64 content while preserving Korean characters during config.json read and write operations.

Do I need a Personal Access Token to write to config.json through a GitHub Pages UI?โ–ผ

Yes, you need a GitHub Personal Access Token with contents: write permission to modify config.json through a GitHub Pages UI. The PAT must be stored securely in the browser's localStorage to authenticate your API-driven commit requests safely.

What is the best way to wire an HTML form to a config.json file on GitHub Pages?โ–ผ

The best way to wire an HTML form to config.json on GitHub Pages is using the GitHub Contents API for GET and PUT operations. This pattern maps form fields to JSON parameters and performs SHA-validated commits to ensure safe configuration updates.

Can I use the GitHub Contents API for continuous config.json edits in a docs UI workflow?โ–ผ

Yes, you can use the GitHub Contents API for continuous config.json edits in a docs UI workflow by implementing SHA verification on every save. Re-fetching the SHA after each successful commit prevents conflicts and maintains workflow alignment during sequential updates.