Skip to content

weblineindia/n8n-Validate-mobile-app-deep-links-in-GitHub-PRs-with-automated-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

GitHub PR Deep-Link & Routing Validator (ExecuteCommand + GitHub Comment)

🚀 Quick-Start TL;DR

  1. Import the workflow JSON into n8n (Cloud or self-hosted).
  2. Create a GitHub Personal Access Token with repo:public_repo (or repo) scope and add it to n8n credentials.
  3. Open the “CONFIG - Variables” node and tweak:
    • manifestPath – path to your deep-link manifest (AndroidManifest.xml, Info.plist, etc.).
    • scriptPath – helper script that boots the emulator & checks each route.
  4. Enable the workflow. Every push to a PR branch triggers validation and posts a Markdown pass/fail matrix back to the PR.

What It Does

This workflow delivers an automated, CI-friendly smoke-test of every deep link defined in your mobile app. On each push to an open GitHub PR, it:

  • Clones the PR branch.
  • Runs a lightweight validation script (provided) that spins up an emulator/simulator, attempts to open each declared URI, and records OK/FAIL.
  • Generates a Markdown table summarizing the results.
  • Comments that table in the PR, letting reviewers spot broken schemes at a glance.

Who's It For

  • Mobile teams maintaining Android or iOS deep-link manifests.
  • CI engineers who need a simple, language-agnostic check they can publish to each PR.
  • OSS maintainers wanting a template-library-ready n8n recipe.

Requirements

Requirement Notes
n8n account Cloud / CE Works everywhere; self-hosted users need Docker with Android / Xcode if validating on-runner.
GitHub Personal Access Token Used for posting PR comments.
Emulator-capable runner Local dev hardware or CI image that can run adb / xcrun simctl.

How It Works

  1. GitHub Trigger fires on pull_requestsynchronize (i.e., each push to the PR branch).
  2. Set (CONFIG - Variables) centralises repo URL, manifest path, script path, timeout, and comment mode.
  3. ExecuteCommand clones the repo and calls the validation script.
  4. Function converts CLI CSV output into a Markdown table.
  5. GitHub node posts (or appends) the results as a comment on the PR.

How To Set Up

  1. Auth: In n8n, add a GitHub credential with your PAT named “GitHub Personal Access Token”.
  2. Import: Settings → Import workflow and paste the JSON above.
  3. Edit Config: Double-click CONFIG - Variables and change any default values.
  4. Validation Script: Commit scripts/validate_deeplinks.sh into your repo (see sample below).
  5. Enable the workflow. Push to any PR branch and watch the comment appear.

Sample validate_deeplinks.sh

#!/usr/bin/env bash
set -e

while getopts "m:" opt; do
  case $opt in
    m) MANIFEST="$OPTARG" ;;
  esac
done

echo "⇨ Parsing deep links from $MANIFEST"

# rudimentary parser—replace with something smarter for XML/Plist
grep -oE 'http[s]?://[^" ]+' "$MANIFEST" | while read -r uri; do
  if adb shell am start -W -a android.intent.action.VIEW -d "$uri" >/dev/null 2>&1; then
    echo "$uri,OK"
  else
    echo "$uri,FAIL"
  fi
done

🧪 How To Customise

Customization Method
Multiple manifests Duplicate the Execute-Command step or extend the script to accept a list of file paths.
Replace-latest comment Switch commentMode to replace-latest and update the GitHub node to search for the newest bot comment before editing.
Status checks instead of comments Call the GitHub API → “Create Commit Status” endpoint to show a Green/Red checkmark on the PR instead of a text comment.
Change validation logic Modify the scripts/validate_deeplinks.sh file to include specific regex or complex URI parsing.

➕ Add-Ons (Advanced)

Add-On Idea
📱 Multi-platform sweep Loop over both Android and iOS manifests and aggregate the results into a single summary table.
💬 Slack/Teams alert Push failure notifications into your team's chat channel of choice via the Incoming-Webhook node.
🌐 Parallel device grid Trigger multiple emulators (e.g., API 19 through API 34) simultaneously to catch OS-specific routing issues.
📊 Historical Tracking Send validation results to a PostgreSQL or Google Sheet to track deep-link stability over time.

About

Automate deep link validation in GitHub pull requests with this n8n workflow automation. This n8n automation runs automated tests to verify mobile app deep links, detects broken URLs early, and posts results back to PRs. A reusable n8n workflow template for CI/CD, mobile QA, and developer productivity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors