gha-pr-merge-ref-shows-upstream-changes

gha-pr-merge-ref-shows-upstream-changes is a skill for Claude Code from wan-huiyan/agent-traffic-control. It costs 306 tokens per session (2,427 once invoked), scanned A, original, MIT.

A guide to GitHub Actions checks that run against a temporary combination of a pull-request branch and the current main branch. This combined version may include changes merged from another pull request.

In plain words
What is it for?
Use it to investigate pull-request-only failures, identify the code actually tested, and distinguish your branch's problems from newly merged main-branch changes.
Why use it?
It explains why CI can fail on code you did not change even though the same commit passes locally.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions Claude Code.

Part of the agent-traffic-control plugin — 105 skills shipped together

Good fit Use it to investigate pull-request-only failures, identify the code actually tested, and distinguish your branch's problems from newly merged main-branch changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/agent-traffic-control/gha-pr-merge-ref-shows-upstream-changes
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add wan-huiyan/agent-traffic-control --skill gha-pr-merge-ref-shows-upstream-changes
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 105 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gha-pr-merge-ref-shows-upstream-changes

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/gha-pr-merge-ref-shows-upstream-changes/github.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/gha-pr-merge-ref-shows-upstream-changes)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/gha-pr-merge-ref-shows-upstream-changes"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/gha-pr-merge-ref-shows-upstream-changes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gha-pr-merge-ref-shows-upstream-changes

Your own site · 80×15
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/gha-pr-merge-ref-shows-upstream-changes"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/gha-pr-merge-ref-shows-upstream-changes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 306 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,427 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00306 $0.02427
Opus 5 $0.00153 $0.01213
Sonnet 5 $0.00061 $0.00485
Haiku 4.5 $0.00031 $0.00243

Measured 11d ago against content hash ae915941032c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

gha-pr-merge-ref-shows-upstream-changes scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/agent-traffic-control/skills/gha-pr-merge-ref-shows-upstream-changes/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GHA pull_request Event Uses Merge-Ref, Not Head-Ref

Problem

You push a commit to a PR branch at T0. CI starts running at T0+10s. A sibling PR merges to main at T0+5s. Your CI run sees the sibling's changes mixed into your branch and fails on something neither side introduced alone.

Most confusingly: locally on the exact same commit SHA, every check passes. gh run view <N> --json headSha reports your SHA correctly. git show <SHA>:<file> shows your file is clean. But CI failed on that SHA citing duplicates / conflicts / violations that aren't there.

Context / Trigger Conditions

  • CI failure on a pull_request event (NOT push)
  • Failure cites a violation in a file you didn't touch in your last push
  • The same SHA passes the same check locally
  • gh run view <N> --json headSha matches your local HEAD
  • git fetch origin main && git rev-list --left-right --count origin/main...HEAD shows main is ahead by 1+ commits since your push
  • The failure message references identifiers / strings present in main but not in your branch (e.g. "duplicate ID X" where X was added to main by a PR that merged seconds before your CI ran)
  • You're in a dense parallel-PR window (multiple PRs merging within minutes — release day, mass-merge sweep, several agents shipping concurrently)

Root cause

GitHub Actions, when triggered by pull_request: [opened, synchronize, reopened, ...], checks out a SYNTHETIC ref called refs/pull/<N>/merge. This ref is the **3-way merge of refs/pull/<N>/head + refs/heads/main

  • their merge-base**, recomputed by GitHub every time either side changes.

Concretely:

Local view:  your-branch-HEAD  (clean)
CI view:     merge(your-branch-HEAD, main-HEAD-at-CI-start)  (may have collisions)

GitHub regenerates the merge ref whenever:

  • The PR branch is pushed
  • The base branch (main) receives a new commit
  • The PR is rebased / force-pushed

If main moves between your push and your CI's checkout step, the merge ref includes main's NEW state plus your branch.

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 228 lines · 306 tokens per session scan A ae915941032c

Subscribe to this mod's changes

gha-pr-merge-ref-shows-upstream-changes is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed 6d ago), licensed MIT. It adds 306 tokens to every session and 2,427 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

cloudflare-workers-ci-cd

Complete CI/CD guide for Cloudflare Workers using GitHub Actions and GitLab CI. Use for automated testing, deployment pipelines, preview environments, secrets management, or encountering deployment failures, workflow errors, environment configuration issues.

secondsky/claude-skills · 50 tokens

babysit

PR babysitter: monitors CI status, auto-rebases when behind, auto-fixes CI where possible, delegates review comment handling to dlc:pr-check, and re-requests review after fixes. Designed for /loop usage with Remote Control.

rube-de/cc-skills · 53 tokens

claude-plugin-repo-ci-release

Wire up CI validation and automatic release-cutting for a Claude Code plugin or marketplace repo (a repo with a .claude-plugin/marketplace.json and plugins/). Adds two GitHub Actions — a structure validator that runs on every PR/push, and a release-on-version-bump job that cuts a GitHub Release whenever a VERSION file…

wan-huiyan/claude-ecosystem-hygiene · 308 tokens

abd-devops

ABD DevOps agent: scaffolds CI/CD, validates .env.example coverage, checks Dockerfile hygiene, and handles release tasks.

RealDougEubanks/ClaudeMarketplace · 30 tokens

pr-watch

Local PR watcher. Monitors CI status, automatically fixes failing checks by reading failure logs and applying targeted fixes, then optionally merges when all checks pass. Local CLI analog to Claude Code's cloud auto-fix feature.

SethGammon/Citadel · 46 tokens

swarm-migrate

Cross-repo migration swarm — one coordinator + N parallel subagents (one per target repo) that apply the same transformation, open PRs, wait for CI, and report back to a shared JSON ledger. Coordinator handles topology, conflict auto-rebase, and stop-on-novel-failure. Use when bumping a shared dependency, rolling out…

yonatangross/orchestkit · 103 tokens