Automated Deep Link Validation for GitHub Pull Requests - n8n Workflow

Use this robust n8n workflow to automatically validate mobile deep links embedded in code during GitHub PR creation. This specialized n8n template executes local shell scripts and reports results directly back to GitHub PR comments.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Ideal User Profile:

Mobile Development Teams: Specifically those needing continuous integration checks on deep link routing.
DevOps Engineers: Responsible for maintaining CI/CD pipelines and automating pre-merge checks.
n8n Users: Looking for advanced examples of how to integrate the Execute Command n8n node with version control systems.
Technical Leads: Seeking to implement reliable, automated quality gates using powerful n8n templates.

Overview

When developing mobile applications, ensuring deep links (application routing schemes) are correctly configured and functional is critical. Manual testing of every link on every Pull Request (PR) is time-consuming and prone to error.

This sophisticated n8n workflow solves this problem by providing an automated quality gate. Triggered by a GitHub webhook, the n8n node environment checks out the relevant repository branch, executes a custom validation script (which usually checks links against an AndroidManifest.xml or similar configuration file), and then formats the output into a clean, readable Markdown table. This table is then automatically posted back as a comment on the original PR. This use of a dedicated n8n node dramatically speeds up testing and ensures link integrity across the codebase. Implementing this powerful n8n automation means faster merging and fewer production bugs related to broken application routing.

How it Works

This automation starts with a critical component, the n8n trigger.


  1. Trigger (GitHub PR Webhook): The n8n workflow is initiated when a specific POST request hits the configured webhook path (validate-pr). This is typically set up as a GitHub webhook that fires upon PR synchronization or opening.

  2. Configuration (CONFIG - Variables): The flow immediately enters a Set n8n node to define essential variables extracted from the webhook payload, such as repoUrl, pullRequestNumber, branchName, and paths to the validation script and manifest file. This centralizes configuration for the entire n8n automation.

  3. Execution (Run Validation Script): The Execute Command n8n node is the core of this n8n template. It runs a complex shell script. This script first clones the target branch into a local temporary directory (/tmp/validation), grants execution permissions, and runs the configured validation script (validate-links.sh), passing the manifest file path as an argument. The script is expected to output comma-separated results (URL, Status).

  4. Data Processing (Format Markdown): A Function n8n node processes the standard output (stdout) received from the command execution. It iterates through the comma-separated lines, checks if the status is 'OK', and constructs a beautifully formatted Markdown table using emoji (✅/❌) to visualize the validation status.

  5. Final Action (GitHub): Finally, the GitHub n8n node uses the configured credentials to create a new comment on the originating Pull Request. The body of the comment is the formatted Markdown table generated in the previous step, providing immediate feedback on the deep link validation status directly within the GitHub UI. This completes the fully automated n8n workflow cycle.

Installation Guide

Setting up this n8n Workflow


  1. Import the n8n Template: Copy the JSON data and import it directly into your n8n instance via the 'New' menu and 'Import from JSON' option.

  2. Set up Credentials:

GitHub Credentials: You will need to configure a GitHub API credential within n8n. This requires a Personal Access Token (PAT) with appropriate permissions (repo scope) to read repository data and write PR comments. Assign this credential to the GitHub n8n node.

  1. Configure Webhook n8n Trigger:

The GitHub PR Webhook n8n node provides a unique URL.
Copy this URL and configure it in your target GitHub repository's webhooks settings, ensuring it listens for Pull Request events.

  1. Adjust Variables: Open the CONFIG - Variables n8n node and update the following placeholders to match your environment:

repositoryFullName: e.g., your-org/your-repo.
* manifestPath and scriptPath: Ensure these paths accurately reflect where the AndroidManifest.xml (or equivalent link config) and your custom validation script are located relative to the repository root.

  1. Ensure Execution Environment: Because this n8n workflow relies on the Execute Command n8n node, the n8n host machine (or Docker container) must have git and sh available in its path to execute the commands successfully.

Node Details

Key n8n Node Breakdown

GitHub PR Webhook (n8n trigger)
Function: Serves as the starting n8n node, awaiting external signals from GitHub to begin the validation process.
Key Configuration: Configured to listen on path /validate-pr using the POST method.
CONFIG - Variables (Set n8n node)
Function: Centralizes variables like the repository details, script paths, and the dynamic pullRequestNumber required for downstream operations within the n8n workflow.
Key Configuration: Defines multiple dynamic and static string parameters necessary for scripting and API interaction.
Run Validation Script (Execute Command n8n node)
Function: Executes critical shell commands to clone the code, check file existence, set execution rights, and run the custom validate-links.sh script. This is where the core logic of this n8n template resides.
Key Configuration: The command script uses expressions like {{ $json.repoUrl }} and {{ $json.branchName }} to dynamically construct the git clone command, ensuring the correct PR content is validated.
Format Markdown (Function n8n node)
Function: Transforms the raw script output into structured, user-friendly Markdown, making the results consumable for the GitHub comment.
Key Configuration: Uses JavaScript to split the output by newline and comma, appending rows with conditional emoji (✅/❌) based on the validation status.
GitHub (GitHub n8n node)
Function: Posts the formatted validation results back to the source Pull Request as a new comment.
* Key Configuration: Uses the createComment operation and dynamically pulls the issueNumber (PR number) and repository details from the CONFIG - Variables n8n node output.

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by

A Leading Software Engineering, Consulting & Outsourcing Services Company in USA & India serving Clients Globally since 1999.

Featured*