n8nSoftwareInfra & DevOpsAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Auto-Generate GitHub Release Notes and Notify Slack with n8n

Enter repo info → fetch latest tag and merged PRs → group by label into Markdown draft → create GitHub draft release → Slack notification

Some experienceStepsWorkflowTip
Who
Open-source maintainers, DevOps engineers, and engineering teams needing structured release notes
You get
On manual trigger, generates label-grouped Markdown release notes from merged PRs, creates a GitHub draft release, and sends a summary to Slack
You need
n8n

Constraints

Requires a n8n Cloud or self-hosted instance. Prerequisites: semantic version tags exist in the GitHub repo; PRs carry labels (e.g., feature/bug/performance); GitHub API credentials configured (PAT or OAuth with repo and write:repo_hook scopes); Slack credentials configured (Webhook URL or OAuth). The workflow is triggered manually via form, not on a schedule.

What they did

Author weblineindia published an n8n workflow template on n8n.io. The template collects repo info via an n8n Form Trigger, calls GitHub APIs to get the latest tag and its commit time, queries merged PRs since then, groups them by label using a Code node with configurable labelMap, generates Markdown release notes with a QA checklist, creates a GitHub draft release, and sends the result to Slack. The template includes full node configurations, JavaScript grouping logic, and a troubleshooting table.

How it went

The author reports the workflow can auto-generate structured release notes and create a draft release (author_report). The template is listed as published on n8n.io with 377 views at time of collection. This site has not imported or run the workflow; behavior under different repo sizes or labeling strategies is unverified.

Worth knowing

1. The workflow uses a manual form trigger, not a scheduled run; add a Cron node if periodic execution is needed. 2. PRs must have labels to group correctly; unlabeled PRs land in "📋 Others". 3. The Code node hard-codes node name references (e.g., $('Config').first()); renaming nodes requires updating the code. 4. The Slack node's url parameter is an empty string in the template and must be filled with your actual Webhook URL after import. 5. GitHub Search API rate limits may affect large repos or high-frequency releases. 6. No long-term runtime records or performance data from real projects are provided by the source.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Get Latest Git Tag node: connect GitHub API credentials.
  • Get Latest Git Tag node: connect HTTP Header Auth credentials.
  • Github Pre Release node: connect HTTP Header Auth credentials.

Configuration to replace

  • Source template is n8n public workflow #6763 (~10 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Enter repository info via form

    When running the workflow in n8n, fill in the form: Repository Owner (GitHub user or org), Repository Name, and Branch Name (e.g., main). All three fields are required.

  2. Config node extracts input and defines label grouping

    The Config node (Edit Fields/Set) maps form inputs to repoOwner, repoName, and defaultBranch, and defines labelMap and qaChecklist. labelMap determines how PR labels are mapped to release-note section headings; qaChecklist appends QA items at the end. Modify the mapping as needed.

  3. Fetch latest tag and its commit date

    Call GitHub API `GET /repos/{owner}/{repo}/tags` to get the latest tag (authenticated with githubApi credentials), then follow that tag's commit.url to retrieve the exact commit timestamp. This timestamp sets the boundary for "since last release".

  4. Query merged PRs after that timestamp

    Use the GitHub Search API: `is:pr is:merged repo:{owner}/{repo} base:{branch} merged:>={tag_commit_date}`. Results include PR titles, numbers, and label arrays for grouping.

  5. Group by label and generate Markdown release notes

    A Code node runs JavaScript that reads labelMap and qaChecklist from the Config node, groups PRs by matched labels, and outputs formatted Markdown with sections and a QA Checklist. Unmatched PRs fall under "📋 Others".

    Execution prompt · Source text。n8n Code node 'Adjusted: Group PRs & Generate Release Notes' JS Code field

    // SAFELY access config node data
    const configNode = $('Config').first();
    if (!configNode) {
      throw new Error("Missing 'Config' node or it's not accessible.");
    }
    
    const labelMap =  configNode.labelMap|| {};
    const qaChecklist = configNode.qaChecklist || [];
    
    console.log("Your message", labelMap);
    console.log("Your message", qaChecklist);
    
    // Access PR list from previous node
    const prNode = $('Fetch All Merged PRs Since Last Tag').first(); // <-- Replace with your actual PR-fetch node name
    if (!prNode || !prNode.json || !Array.isArray(prNode.json.items)) {
      throw new Error("Pull request data not found or improperly formatted.");
    }
    
    const prItems = prNode.json.items;
    
    /** @type {Record<string, string[]>} */
    const grouped = {};
    
    // Loop through each PR
    for (const pr of prItems) {
      const labels = pr.labels?.map(l => l.name) || [];
      const matchedKey = labels.find(l => labelMap[l]);
      const groupTitle = matchedKey ? labelMap[matchedKey] : "📋 Others";
    
      if (!grouped[groupTitle]) {
        grouped[groupTitle] = [];
      }
    
      grouped[groupTitle].push(`- ${pr.title} (#${pr.number})`);
    }
    
    // Build Markdown content
    let markdown = `## 📝 Release Notes\n`;
    
    for (const group in grouped) {
      markdown += `\n### ${group}\n`;
      markdown += grouped[group].join("\n") + "\n";
    }
    
    markdown += `\n## ✅ QA Checklist\n`;
    markdown += qaChecklist.map(item => `[ ] ${item}`).join("\n");
    
    return [
      {
        json: {
          release_notes: markdown,
        },
      },
    ];
  6. Create GitHub draft release and notify Slack

    The GitHub Pre-release node POSTs to `/repos/{owner}/{repo}/releases` with tag_name, name, body (the generated release_notes), draft=true, and prerelease=false. The Slack node then sends the release notes and release link to the configured channel. The Slack node's url field must be set to your actual Webhook URL.

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are setting up an n8n workflow that auto-generates draft release notes from merged GitHub PRs and posts to Slack. First confirm you have: 1) an accessible n8n instance; 2) a GitHub PAT or OAuth app with repo and write:repo_hook scopes; 3) a Slack Incoming Webhook URL or equivalent credential. Then import the workflow JSON, configure credentials, fill in the form fields, and trigger manually to test. If PRs lack labels, update the labelMap in the Config node or ensure PRs are labeled before merging.

If the Slack message is empty, verify $json.release_notes is passed correctly. If you see 'draft must be boolean', ensure the draft field is true (boolean) not "true" (string) in the HTTP node JSON.

Source

Auto-generate GitHub release notes and notify via Slack · weblineindia · n8n.io · 2025-08-01

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related