Schedule icon
Request icon
Script icon
If icon
Get icon
DiscordExecution icon
Set icon
Log icon

GitHub Release to Discord Alert with Duplicate Detection

Schedule-driven Kestra flow that queries GitHub Releases API, filters drafts with Python, and posts Discord alerts for new tags using KV-backed deduplication.

Categories
Infrastructure

Stop finding out about upstream releases from a colleague or a broken build. This blueprint watches any GitHub repository on a six-hour schedule, compares the latest release tag against a KV-backed last-known value, and posts a rich Discord embed the moment a genuinely new version lands, complete with tag, author, publish date, and a truncated changelog summary. Draft releases are filtered out, duplicate alerts are suppressed, and the error handler sends its own Discord message if the monitoring flow itself breaks, so you never silently miss a release.

How it works

  1. A Schedule trigger (io.kestra.plugin.core.trigger.Schedule) fires every six hours via the cron 0 */6 * * *.
  2. The fetch_latest_release task (io.kestra.plugin.core.http.Request) calls the GitHub Releases API at /repos/{owner}/{repo}/releases/latest with a bearer token and allowFailed: true so a 404 for repos with no releases does not crash the flow.
  3. The parse_release task (io.kestra.plugin.scripts.python.Script) deserializes the JSON, extracts the tag name, release name, author, published date, pre-release flag, and a 300-character body summary, then sets should_alert to false for drafts or empty tags.
  4. An outer If flowable (io.kestra.plugin.core.flow.If) gates all downstream work on should_alert == true.
  5. Inside the gate, a kv.Get task retrieves the last-known tag from the Kestra KV store. A nested If compares it to the fetched tag; only a mismatch triggers the alert path.
  6. The send_discord_alert task (io.kestra.plugin.discord.DiscordExecution) posts a color-coded embed with the release name, tag, author, date, pre-release status, changelog snippet, and a direct link.
  7. A kv.Set task persists the new tag so the next run skips it.
  8. The errors block sends a separate Discord embed if any task fails, ensuring the monitoring itself is monitored.

What you get

  • Timely Discord alerts the moment a new release is published, without RSS polling lag.
  • KV-backed deduplication so repeated schedule runs never spam the channel.
  • Draft filtering that keeps noise out of the alert channel.
  • A truncated changelog summary in every embed for at-a-glance context.
  • A dedicated error notification ensuring silent monitoring failures are impossible.
  • Full execution history in Kestra for auditing when each release was detected.

Who it's for

  • Platform and DevOps engineers tracking upstream dependencies for upgrade planning.
  • Open-source maintainers who want instant team visibility on new releases of tools they depend on.
  • Release managers who coordinate downstream deployments when an upstream library ships.

Why orchestrate this with Kestra

A GitHub webhook could push release events, but it requires a publicly reachable endpoint, webhook secret management, and custom server code. A cron script works until the machine reboots or the state file gets lost. Kestra replaces both with declarative YAML: the schedule is version-controlled, the KV store persists deduplication state across runs without an external database, retries protect against transient GitHub or Discord outages, and the execution timeline shows exactly when each release was detected and whether the alert was sent or skipped.

Prerequisites

  • A Kestra instance (v2.0+) with the Discord and Script (Python) plugins installed.
  • A GitHub personal access token with repo (or public_repo for public repositories) scope.
  • A Discord server with an incoming webhook configured on the target channel.

Secrets

  • GITHUB_TOKEN: GitHub personal access token used to authenticate API requests and avoid rate limits.
  • DISCORD_WEBHOOK: Discord incoming webhook URL where release alerts are posted.

Quick start

  1. Store GITHUB_TOKEN and DISCORD_WEBHOOK as secrets in your Kestra namespace.
  2. Adjust the github_owner and github_repo input defaults to the repository you want to watch, or leave them as kestra-io/kestra for an immediate test.
  3. Execute the flow manually once. Check the parse_release outputs and verify the Discord embed arrives.
  4. Enable the release_check_schedule trigger. The KV store will initialize on the first run and suppress duplicates from the second run onward.

How to extend

  • Watch multiple repositories by wrapping the flow in a Loop over an ARRAY input of owner/repo pairs.
  • Add Slack or PagerDuty tasks alongside Discord for multi-channel alerting.
  • Filter pre-releases by adding and not is_prerelease to the should_alert condition in the Python script.
  • Trigger a downstream CI/CD pipeline (e.g., dependency update PR) by adding a kestra.plugin.core.flow.Subflow task after the alert.
  • Shorten or lengthen the schedule cron for critical vs. low-priority dependencies.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.