feat: automated upstream release watcher for pritunl-zero#10
Draft
feat: automated upstream release watcher for pritunl-zero#10
Conversation
… inputs Agent-Logs-Url: https://github.com/yarons/pritunl-zero-docker/sessions/f6e1a9bf-6c84-4b4c-83a6-13ce27a36d14 Co-authored-by: yarons <406826+yarons@users.noreply.github.com>
…rd on commit step) Agent-Logs-Url: https://github.com/yarons/pritunl-zero-docker/sessions/f6e1a9bf-6c84-4b4c-83a6-13ce27a36d14 Co-authored-by: yarons <406826+yarons@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add automated upstream release watcher GitHub Actions workflow
feat: automated upstream release watcher for pritunl-zero
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a polling workflow that watches
pritunl/pritunl-zerofor new GitHub Releases and automatically dispatches the build+push pipeline when one is detected.New:
.github/workflows/watch-pritunl-zero-release.ymlcron) and supports manualworkflow_dispatchgh api, strips leadingvto produceversion.github/upstream-versions/pritunl-zero.txt; exits early if unchangeddocker-image.ymlwithversion+upstream_taginputs, then commits/pushes updated state filesuccess()— a failed dispatch won't silently advance the stored tagcontents: write+actions: writepermissions;concurrencygroup prevents overlapping runsUpdated:
.github/workflows/docker-image.ymlupstream_taginput (raw tag, e.g.v1.2.3)New:
.github/upstream-versions/pritunl-zero.txtEmpty state file; first watcher run will always fire a dispatch. To force a re-dispatch on a later run, reset this file to an older/blank value.
Manual test
docker-image.ymlrun shows correctversion/upstream_tagin the echo step.github/upstream-versions/pritunl-zero.txtand re-run the watcherOriginal prompt
Create a pull request in repository
yarons/pritunl-zero-dockerthat adds an automated “upstream release watcher” GitHub Actions workflow.Context / goal
workflow_dispatchwhenever a new GitHub Release is published inhttps://github.com/pritunl/pritunl-zero.Watcher behavior
.github/workflows/(name appropriately) that:workflow_dispatch..github/upstream-versions/pritunl-zero.txt.versionby stripping a single leadingvfrom the upstream tag (e.g.v1.2.3->1.2.3).workflow_dispatch, passing inputs (version + upstream_tag)..github/upstream-versions/pritunl-zero.txtto the new upstream tag and commits/pushes that change back to the default branch.Build workflow updates
.github/workflows/).workflow_dispatchwith inputs:version(no leading v)upstream_tag(raw tag, e.g. v1.2.3)on:triggers intact).Permissions and safety
contents: write(commit state file)actions: write(dispatch workflow)concurrencyto prevent overlapping watcher runs.GITHUB_TOKEN(default token) andghCLI for API calls and to dispatch the build workflow.Testing / validation
workflow_dispatch.github/upstream-versions/pritunl-zero.txtto an older value to force a dispatch.Keep changes minimal and focused.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Can I trigger GitHub action on my repo when another repo has released a new version?
Assistant: Yes—there are a few common ways to do this, depending on who “owns” the other repo and what kind of release signal you can rely on.
Option 1 (best when you control both repos):
repository_dispatchFlow
release(or when a release is published).repository_dispatchevent to your repo.on: repository_dispatchruns.Pros: near real-time, reliable, no polling.
Cons: needs a token with permission to dispatch to your repo.
Option 2 (often simplest): scheduled polling in your repo
Flow
on: schedule) every X minutes/hours.Pros: works even if you don’t control the other repo.
Cons: not instant; you need to store “last seen” release tag/version somewhere (artifact, cache, issue/commit, GitHub environment variable, etc.).
Option 3 (public repo releases): subscribe via webhooks → dispatch
GitHub webhooks can notify on
release, but they deliver to an HTTP endpoint you host. That endpoint can then trigger your repo (again viarepository_dispatchorworkflow_dispatch).Pros: real-time and works when you don’t control the other repo (if you can configure webhook).
Cons: requires running/hosting a small service; and you must be able to configure a webhook on the other repo.
Option 4: reusable workflow (
workflow_call) doesn’t “listen” to releasesReusable workflows are great for sharing CI logic, but they don’t automatically trigger from another repo’s release unless something (a workflow) calls them. So they’re not a standalone solution to “on external release”.
Quick question so I can point you to the right setup
Do you control the other repo (i.e., can you add a workflow/webhook to it), or is it a third-party repo you can only read from? Also, is the other repo public or private?
User: No, I don't.
Assistant: If you don’t control the other repo, then your realistic options are:
1) Poll for new releases on a schedule (most common)
In your repo, run a scheduled workflow that checks the other repo’s latest release/tag via the GitHub API, and only continues when it changes.
Trigger:
on: schedule(plus optionallyworkflow_dispatchso you can test manually)**Che...
This pull request was created from Copilot chat.