Github upstream sync
Reusable agent skills for Codex, Claude Code, OpenCode, and other AI coding agents.
npx -y skills add mabyko/AgentSkills --skill github-upstream-syncAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use only when the user explicitly asks to create or review an upstream-sync GitHub Actions workflow for a fork repository, especially with phrases like upstream sync, fork sync, gh repo sync, or syncing fork branches from upstream.
SKILL.md
4.1 KB, 957 tokens by cl100k_base, as published. Nobody here has run it
GitHub Upstream Sync
Use this skill when the user wants a GitHub Actions workflow that keeps a fork branch synced with an upstream repository.
Inputs
- Target branch, default
main. - Upstream branch, default target branch.
- Schedule, default daily if the user gives only a time.
- Timezone from explicit user text first; otherwise use session/environment timezone if available.
- Upstream source repo, optional. Use it only when the user provides one or the fork parent is ambiguous.
- Token secret name, default
GH_TOKEN.
Workflow
- Convert the requested schedule to GitHub Actions cron in UTC. If the user writes
4:00or4시 25분without a timezone, use the session/environment timezone. If no timezone is available, ask for it. - If target branch and upstream branch are the same, prefer
gh repo sync "${{ github.repository }}" --branch <branch>. - Add
--source OWNER/REPOtogh repo synconly when the user specifies the upstream repo or the fork parent should not be trusted. - If target branch and upstream branch differ, use
aormsby/Fork-Sync-With-Upstream-actionwith separatetarget_sync_branchandupstream_sync_branch. Check the action's latest release tag before pinning; the template's pinned version may be stale. - Use
GH_TOKEN: ${{ secrets.GH_TOKEN }}by default. The secret must be a PAT that can write contents and workflow files in the target fork. This avoids failures when upstream adds or modifies.github/workflows/*. - Use
permissions: contents: readbecause the write authority comes from the PAT secret, not fromgithub.token. - Do not use
permissions.actions: writeto solve workflow-file sync failures; that permission controls Actions API operations, not writing workflow YAML files. - Keep generated workflow YAML short. Do not add comments unless the user asks for annotated output.
Templates
Same branch:
name: Upstream Sync
on:
schedule:
- cron: "<utc-cron>"
workflow_dispatch:
permissions:
contents: read
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Sync fork with upstream
run: gh repo sync "${{ github.repository }}" --branch <branch>
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
If source is needed, append --source OWNER/REPO to the gh repo sync command.
Different branches:
name: Upstream Sync
on:
schedule:
- cron: "<utc-cron>"
workflow_dispatch:
inputs:
sync_test_mode:
description: "Dry run mode"
type: boolean
default: false
permissions:
contents: read
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout target branch
uses: actions/checkout@v4
with:
ref: <target-branch>
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
persist-credentials: false
- name: Sync upstream changes
id: sync
uses: aormsby/[email protected]
with:
target_sync_branch: <target-branch>
target_repo_token: ${{ secrets.GH_TOKEN }}
upstream_sync_branch: <upstream-branch>
upstream_sync_repo: <owner/repo>
test_mode: ${{ inputs.sync_test_mode }}
- name: Sync Success Check
if: steps.sync.outputs.has_new_commits == 'true'
run: echo "New commits were synced."
- name: Already Up to Date Check
if: steps.sync.outputs.has_new_commits == 'false'
run: echo "Already up to date."
Output
Return the workflow YAML and a brief note that GH_TOKEN must be a PAT with contents write and workflow-file permission for the target fork.
Example Prompts
$github-upstream-sync 내 저장소의 main 브랜치를 upstream main과 매일 4시에 동기화하는 workflow 만들어줘.$github-upstream-sync 내 저장소의 main 브랜치에 upstream develop을 매일 KST 04:25에 동기화하고 dry run 체크박스도 넣어줘.
What ships with it: 1 file
281 B alongside SKILL.md
agents/
- openai.yaml281 B