n8n Workflow
Intermediate

Sync GitHub Releases with GitLab Issues

Automate your development workflow by automatically creating a GitLab issue for every new GitHub release. This template prevents duplicate issues and keeps your team in sync with upstream projects.

Overview

Automatically creates a GitLab issue to track new releases from an upstream GitHub repository, ensuring development and update tasks are never missed.

🗂️ Description & Use Case

This workflow automates the process of tracking upstream GitHub releases by creating corresponding issues in a GitLab project. It's designed to run on a schedule, check for the latest release, and intelligently create a new issue only if one doesn't already exist for that release, preventing duplicate tasks.

How It Works:

  1. Scheduled Trigger: The workflow runs automatically on a weekly schedule using the Cron node. You can adjust the schedule to fit your needs (e.g., daily, hourly).
  2. Fetch Data: It simultaneously fetches the latest release from a specified GitHub repository (Get latest release) and lists all open issues from your target GitLab project (List issues).
  3. Check for Duplicates: The Merge node combines the data from GitHub and GitLab. A custom Function node then checks if an issue already exists for the latest release by comparing the release tag (tag_name) against the titles of existing GitLab issues.
  4. Create Issue (If Needed): If no corresponding issue is found, the Create issue node automatically creates a new issue in GitLab. The issue is pre-populated with the release tag in the title and the release notes and URL in the body, providing all necessary context for your team.
  5. Prevent Redundancy: If an issue for the release already exists, the workflow stops at the function node, ensuring your issue tracker remains clean and free of duplicates.

✅ Real-World Use Cases:

  • Upstream Dependency Management: Keep track of new versions of a library or application your project depends on. Automatically create a task for your team to test and integrate the new release.
  • Docker Image Updates: Monitor a base project on GitHub (like linkcheck) and automatically create an issue in GitLab to trigger the process of updating and rebuilding your corresponding Docker image (docker-linkcheck).
  • Release Management: Ensure that every new release of your public project on GitHub is internally tracked for further actions like documentation updates or deployment announcements within GitLab.
  • Streamlining DevOps: Connect your development and operations by creating an auditable trail of releases and the work associated with them, directly within your primary project management tool.

Instructions

Basic steps

  1. Download workflow JSON
  2. Import into n8n
  3. Configure node parameters as needed
  4. Test and enable the workflow

💡 Tips

After importing, verify all connectors and credentials match your environment.

Preview

Workflow Visualization

6 nodes
100%
Get latest releasegithubCroncronMergemergeNo issue for release?functionCreate issuegitlabList issuesgitlab

Nodes

1

Get latest release

github

v1
2

Cron

cron

v1
3

Merge

merge

v1
4

No issue for release?

function

v1
5

Create issue

gitlab

v1
6

List issues

gitlab

v1

Statistics

Total nodes:6
Disabled nodes:0
Node types:5
Connections:6
View full JSON structure
{
  "nodes": [
    {
      "name": "Get latest release",
      "type": "n8n-nodes-base.github",
      "position": [
        540,
        340
      ],
      "parameters": {
        "limit": 1,
        "resource": "release",
        "operation": "getAll"
      },
      "typeVersion": 1
    },
    {
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "position": [
        240,
        500
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyWeek"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        740,
        420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "No issue for release?",
      "type": "n8n-nodes-base.function",
      "position": [
        920,
        420
      ],
      "parameters": {
        "functionCode": "const _ = require('lodash')\n\n// differentiate merged inputs (didnt find a way to get both inputs into one function invocation)\nconst releases = _.filter(items, i => _.has(i, 'json.assets'))\nif (releases.length != 1) throw new Error(`Invalid release count: ${releases.length}`)\nconst release = releases[0]\nconst issues = _.without(items, release)\n//console.log({release,issues})\n\n// check if there's an issue for the release\nconst matchingIssue = _.find(issues, i => i.json.title.includes(release.json.tag_name))\n//console.log({release,issues,matchingIssue})\n\nif (matchingIssue)\n  return []\nelse\n  return [release]"
      },
      "executeOnce": false,
      "typeVersion": 1
    },
    {
      "name": "Create issue",
      "type": "n8n-nodes-base.gitlab",
      "position": [
        1100,
        420
      ],
      "parameters": {
        "body": "={{$json[\"url\"]}}\n\n{{$json[\"body\"]}}",
        "owner": "txlab",
        "title": "=Upstream release: {{$json[\"tag_name\"]}}",
        "labels": [],
        "repository": "docker-linkcheck",
        "assignee_ids": []
      },
      "typeVersion": 1
    },
    {
      "name": "List issues",
      "type": "n8n-nodes-base.gitlab",
      "position": [
        540,
        500
      ],
      "parameters": {
        "owner": "txlab",
        "resource": "repository",
        "repository": "docker-linkcheck",
        "getRepositoryIssuesFilters": {}
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "Get latest release",
            "type": "main",
            "index": 0
          },
          {
            "node": "List issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "No release for issue?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start": {
      "main": [
        [
          {
            "node": "Get latest release",
            "type": "main",
            "index": 0
          },
          {
            "node": "List issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List issues": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get latest release": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No release for issue?": {
      "main": [
        [
          {
            "node": "Create issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Actions

Share
Categories:
Tags:
cronfunctiongithubmergegitlab

Technical Specs

Complexity:
Intermediate
Node Count:
6 nodes
Published:11 months ago
Updated:2 months ago

Compatibility

Platform:
N8N Cloud & Self-hosted
Min Version:
N8N v1.0.0+
Supports cloud and self-hosted deployment

License

This workflow template follows MIT license, you can freely use, modify and distribute.

Please comply with relevant third-party service terms when using.

Related Workflows