Configure an Argo CD ApplicationSet using the Pull Request generator to create a preview Application per open pull request in a GitHub repository

domain: Argo CD · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define an ApplicationSet with a generators entry using pullRequest: github: owner: org repo: repo labels: ["preview"] so only PRs with the preview label get an Application
  2. In the template section, set the Application name using '{{branch}}-{{number}}' and the destination namespace to 'preview-{{number}}' to isolate each PR's resources
  3. Add a syncPolicy: automated: prune: true selfHeal: true block in the template so each preview Application self-heals and prunes stale resources without manual intervention
  4. Set the source.targetRevision to '{{head_sha}}' to pin each Application to the exact commit SHA of the PR head rather than the branch tip, preventing drift during CI runs
  5. Configure a requeueAfterSeconds in the pullRequest generator so Argo CD periodically re-polls GitHub for new or closed PRs and creates or deletes Applications accordingly
  6. Add an ApplicationSet namespace with a NetworkPolicy that blocks preview namespaces from reaching production databases, and annotate the ApplicationSet to apply the policy as a post-sync hook

Known gotchas

Related routes

Generate Argo CD Applications dynamically with an ApplicationSet Git directory generator
argo-cd.readthedocs.io · 6 steps · unrated
Auto-discover repositories across a GitHub organization and generate Argo CD Applications with the ApplicationSet SCM Provider generator
argo-cd.readthedocs.io · 5 steps · unrated
Configure an Argo CD ApplicationSet with the Matrix generator combining cluster and git generators to fan out applications across multiple clusters and directories
argo-cd.readthedocs.io · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans