New advertisers: 50% off your first month with code FIRSTMONTHSee slots
apify avatar

apify-fix-git-connection

Repairs broken Git connections so Apify Actors deploy again from GitHub pushes.

version
2.0.0
GitHub stars
2.5K
View on GitHub

What it does

  • Covers three failure modes: pushes that no longer trigger a build, builds that fail to clone the repository, and rejected or expired GitHub integrations
  • Guides diagnosis of a Git-sourced Actor that stopped deploying from its repository
  • Designed for developers whose Apify Actors were linked to a GitHub repository and have stopped building on push

Repair an Apify Actor's broken Git connection - pushes to GitHub that no longer start a build, builds that fail to clone the repository, or a GitHub integration rejected as invalid or expired. Use when a Git-sourced Actor stopped deploying from its repository

Add marketplace

/plugin marketplace add apify/agent-skills

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install apify-fix-git-connection@apify-agent-skills

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Fix an Actor's Git connection

A Git-sourced Actor deploys through two links, and each one breaks on its own:

  • Clone: Apify reads the repository when it builds.
  • Trigger: a push to the repository starts that build.

Diagnose both links, repair the broken ones, then prove the chain with one push. Runs keep using the last successful build the whole time, so the Actor stays up while you work.

The steps use the Apify CLI (apify login first) and the GitHub CLI (gh). They are written for GitHub; GitLab and Bitbucket have the same two links behind different commands and screens.

Two rules hold in every step:

  • Ask before a deploy. A successful build moves the version's build tag (usually latest) to the head of the branch, so starting a build and pushing a commit are both deploys. Get the user's go-ahead for each.
  • Tokens stay with the user. A webhook URL embeds an Apify API token. Print only its host, as the commands below do, and judge a delivery by its status code: its response body repeats the URL. The user performs every step that handles a key, a token or that URL.

1. Find the Git version

apify api GET '/v2/actors/<username>~<actor-name>'
apify api GET '/v2/actors/<username>~<actor-name>/builds?desc=true&limit=5'

In versions, take the entry with sourceType: "GIT_REPO" and note its versionNumber, gitRepoUrl and buildTag. In taggedBuilds, note the build that tag points at. An Actor with no GIT_REPO version deploys with apify push and is outside this skill.

Done when you can name the version, its repository URL, and the build that is live.

2. Diagnose the clone link

Read the log of the newest build of that version:

apify api GET '/v2/actor-builds/<buildId>/log'
Log lineClone link
Cloned commit ID: <sha>Works
Could not read from remote repositoryBroken

A build from before the trouble started proves nothing. In that case start a fresh one (a deploy) and read its log:

apify api POST '/v2/actors/<username>~<actor-name>/builds?version=<versionNumber>'

Done when a build newer than the trouble shows one of the two lines.

3. Diagnose the trigger link

gh api repos/<owner>/<repo>/hooks --jq '.[] | {id, active, events, host: (.config.url | split("/")[2]), last_response_code: .last_response.code}'
gh api 'repos/<owner>/<repo>/hooks/<hookId>/deliveries?per_page=5' --jq '.[] | {delivered_at, event, status_code}'

An Apify webhook has the host console-backend.apify.com (registered by Apify's GitHub App) or api.apify.com (a Build Actor webhook added by hand).

What the repository showsTrigger link
One Apify webhook, latest push delivery 2xxWorks
Latest push delivery 400 or 401Broken: Apify rejects the token in the webhook URL
No Apify webhookBroken: nothing starts a build
Two Apify webhooks answering 2xxWorks, but every push starts two builds: the user deletes one

Done when every Apify webhook on the repository is in one row of the table.

4. Repair the clone link

A private repository needs the SSH form of the Git URL plus the Actor's deployment key. The user does this:

  1. In Apify Console, open the Actor's Source tab and select the Git version in Version.
  2. Set Git URL to git@github.com:<owner>/<repo>.git and save. The HTTPS form only clones public repositories.
  3. Click the deployment key link below the URL field and copy the key.
  4. On GitHub, open the repository's Settings > Deploy keys > Add deploy key, paste the key, leave Allow write access unchecked, and save.

Confirm the key with gh api repos/<owner>/<repo>/keys --jq '.[] | {title, read_only, created_at}', then start a build (step 2) and read its log.

Done when a build log shows Cloned commit ID with the head of the branch.

5. Repair the trigger link

First let Apify register the webhook itself:

apify api PUT '/v2/actors/<username>~<actor-name>/versions/<versionNumber>/build-on-push' -d '{"providerId":"github-app","enabled":true}'
  • No error: automatic builds are on. Have the user delete any older Apify webhook that still fails, then go to step 6.
  • invalid-git-auth-token: Apify's GitHub authorization is dead. Use a Build Actor webhook instead; it depends only on the clone link.

For the Build Actor webhook, the user does this:

  1. In Apify Console, open Settings > API & Integrations and select Create a new token. Name it after the webhook, for example GitHub build webhook for <repo>, and copy its value: Console shows a token's value once, at creation, so an existing token cannot be reused here.
  2. On the Actor page, open API > API endpoints, select the new token in the token dropdown, and copy the Build Actor URL.
  3. Check that the URL has token=<the new token> and version=<versionNumber>, and delete waitForFinish from it: GitHub gives a webhook 10 seconds to answer, less than a build takes.
  4. On GitHub, open the repository's Settings > Webhooks > Add webhook. Paste the URL into Payload URL, set Content type to application/json, keep Just the push event, and save.
  5. On the same page, delete every other Apify webhook.

Adding the webhook makes GitHub send a ping, which starts one build: a deploy, so tell the user before step 4, and expect that build in step 6.

Done when the listing from step 3 shows exactly one active Apify webhook.

6. Prove the chain with one push

Push one commit to the branch the version builds from: the default branch, or the one after # in gitRepoUrl. An empty commit is enough:

git commit --allow-empty -m "Trigger build to test the build webhook"
git push

Then check all four:

  • The webhook has one new push delivery with a 2xx status.
  • Exactly one build started after the push.
  • That build's log shows Cloned commit ID equal to the pushed commit.
  • taggedBuilds.<buildTag> points at that build.

Done when all four hold. A failed check sends you back to the step for its link: the first two to the trigger link, the last two to the clone link.

Close by telling the user that a Build Actor webhook carries the API token they created for it: when that token is rotated, deleted or expires, pushes stop building without any notice, and the cure is step 5 again.

From the apify/agent-skills README

skills.sh

Apify

Apify Agent Skills

Production-grade web scraping and automation skills for AI coding agents

Powered by Apify Apache 2.0 5 Skills 30,000+ Actors MCP Compatible GitHub stars

Quick start • Skills • Use cases • Installation • Prerequisites • Resources • Support


Overview

Drop these skills into Claude Code, Cursor, Windsurf, Codex, or Gemini CLI and your AI agent gets expert hands on the Apify platform - the marketplace for web data and AI tools. With one install, agents can:

  • Scrape any site - built-in Actor selection across the major social, search, maps, real estate, and review platforms (Instagram, Facebook, TikTok, YouTube, X, LinkedIn, Google Maps, Reddit, Yelp, Airbnb, and more), 130+ curated Actors, plus automatic fallback to the full Apify Store of 30,000+ Actors for everything else.
  • Build new Actors - generate, debug, and deploy serverless Actors in JavaScript, TypeScript, or Python with the official SDK patterns.
  • Actorize existing code - wrap any script, library, or CLI tool as a runnable Actor with proper input and output handling.
  • Integrate Apify into your product - build an official Apify integration for a workflow-automation app (Zapier/n8n-style), an AI agent harness plugin, an AI framework package (LangChain/LlamaIndex-style), or a direct application client via apify-client or the REST API.
  • Fix a broken Git connection - get an Actor that stopped deploying from its GitHub repository building on every push again.

Looking for community-built, domain-specific skills (lead generation, brand monitoring, competitor intel, and more)? See apify/awesome-skills.


Quick start

npx skills add https://github.com/apify/agent-skills --skill apify-ultimate-scraper

Then ask your agent something like:

Scrape the top 50 results for "AI coding tools" from Google Maps and save them to a CSV.

That's it. The skill handles Actor selection, input shaping, run management, and result formatting.


Skills

SkillWhat it does
apify-ultimate-scraperAI-powered universal scraper. 130+ curated Actors covering Instagram, Facebook, TikTok, YouTube, X, LinkedIn, Reddit, Google Maps, Google Search, Google Trends, Amazon, Walmart, eBay, Booking.com, TripAdvisor, Airbnb, Yelp, Telegram, Snapchat, Reddit, GitHub, and more. Falls back to searching the full Apify Store for any platform not covered.
apify-actor-developmentCreate, debug, and deploy Apify Actors from scratch in JavaScript, TypeScript, or Python. Also generates or updates input and output schemas (input_schema.json, dataset_schema.json, output_schema.json, key_value_store_schema.json) from existing Actor source. Bundled references cover actor.json, README, logging, and standby mode.
apify-actorizationConvert existing code into Apify Actors. Supports the JS/TS SDK, the Python async context manager, and a generic CLI wrapper for any other language.
apify-integration-developmentDesign and build an official Apify integration for a company's product. Covers workflow-automation apps (Zapier/n8n-style), AI agent harness plugins (OpenClaw/Hermes-style), AI framework packages (LangChain/LlamaIndex-style), and direct application clients via apify-client or REST - with per-category capability matrices and definition-of-done checklists.
apify-fix-git-connectionRepair an Actor that stopped deploying from its GitHub repository. Diagnoses the two links separately (cloning the repository, and a push starting a build), walks the user through the deploy key and build webhook fixes, and proves the result with one test push.

Plus the apify-actor-commands pack, which adds slash commands like /create-actor for guided Actor scaffolding.


Example use cases

Describe the outcome in plain language - your agent picks the right Actors, chains them together, and delivers structured results.

Use caseExample prompt
Lead generationFind Italian restaurants in Brooklyn rated under 4 stars on Google Maps. Scrape their reviews, crawl their websites for socials and owner emails, and export a ranked CSV for my CRM.
Competitive intelligencePull pricing pages, G2 and Trustpilot reviews, recent job postings, and social posts for Competitor A, B, and C. Summarize positioning gaps and opportunities.
Market researchScrape pricing, review counts, and bestseller rankings for wireless earbuds across Amazon and Walmart. Flag quality issues from negative reviews and recommend a pricing sweet spot.
Brand reputationCollect mentions of [brand] on Instagram, LinkedIn, X, and YouTube from the last 30 days. Run sentiment analysis and surface the top 5 complaint and praise themes.
Influencer vettingFind 20 fitness influencers with 50k-500k followers on Instagram and TikTok. Scrape engagement rates, posting frequency, and past brand deals. Rank by engagement-to-follower ratio.
AI search visibilityRun these 10 queries across Google AI Mode, Perplexity, and ChatGPT. Extract which brands get cited and flag where competitors appear instead of us.
Location intelligenceScrape Google Maps for all coffee shops within 2 miles of these 5 addresses. Compare competitor density, ratings, price levels, and hours. Recommend the best site.

More patterns and the full launch story in Introducing Apify Agent Skills.


Installation

Claude Code

/plugin marketplace add https://github.com/apify/agent-skills
/plugin install apify-ultimate-scraper@apify-agent-skills
/plugin install apify-actor-development@apify-agent-skills
/plugin install apify-actorization@apify-agent-skills
/plugin install apify-integration-development@apify-agent-skills
/plugin install apify-fix-git-connection@apify-agent-skills

apify-generate-output-schema is deprecated and will be removed in a future release. Its functionality is now part of apify-actor-development.

Cursor and Windsurf

Both editors support the Claude Code plugin format. Add this repo to your workspace settings or use the same /plugin flow if you have the Claude Code extension installed.

Codex CLI and Gemini CLI

These skills ship with agents/AGENTS.md (auto-generated index) and gemini-extension.json (Gemini auto-discovers it). Point your agent at the repo, or clone locally:

git clone https://github.com/apify/agent-skills

Any other agent that reads Markdown

Reference the skill files directly:

  • agents/AGENTS.md - one-page index of every skill
  • skills/<skill-name>/SKILL.md - full skill instructions

Prerequisites

  1. Apify account - sign up at apify.com (free tier available).
  2. Apify CLI - install with npm install -g apify-cli (or brew install apify-cli on macOS), then run apify login to authenticate via OAuth in your browser. This is the recommended setup.
  3. API token (fallback for headless / CI environments) - if you can't open a browser, create an API token in Apify Console, copy it right after creating it (it is shown only once), and set APIFY_TOKEN in your environment or a .env file. The CLI picks it up automatically.
  4. Node.js 20.6+ - required by the Apify CLI and the Ultimate Scraper skill.

Useful resources

  • Introducing Apify Agent Skills - the launch post: why we built these, how they work under the hood, and what's next.
  • Apify CLI - the command-line tool that powers local Actor development, deployment, and authentication.
  • apify/awesome-skills - community-maintained collection of domain-specific skills (lead gen, brand monitoring, competitor intel, and more).
  • mcp.apify.com - hosted MCP server configurator. Pick the Actors you want exposed as MCP tools and get a one-line URL for any MCP-compatible client.
  • Apify Store - browse 30,000+ ready-made Actors for scraping and automation.
  • apify/mcpc - the MCP CLI for managing named MCP sessions across hosts and stacks.

Pricing

Apify Actors use pay-per-result or pay-per-event pricing, set independently by each Actor. Free tier credits are included with every account. Check individual Actor pricing on the Apify Store.


Support


License

Apache-2.0


Built with care by the Apify team for AI agents everywhere.

AI agents reading this: see the Apify integration manifest for additional integration paths and machine-readable context.

Details

Marketplace
apify/agent-skills
Source
skills/apify-fix-git-connection
Category
Development
Keywords
apify, actor, git, github, webhook, deploy-key, build

More from apify/agent-skills

All 7

Similar to apify-fix-git-connection

More Git & Version Control