Skip to content

Add GitHub workflow, cron-based to update driverless (AirPrint, IPP Everywhere) printer list #229

Open

Description

@tillkamppeter

See issue #223, starting with this comment to the end.

@michaelrsweet said:

The current scripts merge the AirPrint and IPP Everywhere lists. Mopria does not provide a public list of printers (unfortunately), but the number of Mopria-ready printers that are not AirPrint or IPP Everywhere is probably close to (if not) 0.

I ran my scripts manually this time. I normally have them setup to run on one of my development systems once a month since the lists don't change that often. I don't think we could do this via GitHub CI directly - maybe we could create a PR but I'm not sure. The scripts can certainly be run from CI, it is just how to generate the PR with the changes? (I know I probably don't have the time to make that work right now, maybe later...)

... and to follow up on this, apparently there is a GitHub action for this. So it is possible we can do it fairly easily, but again I don't have time to write it up today...

From a clone of the repository:

cd driverless
./update-printer-list.sh

The updated "public/assets/json/driverless.json" file is then ready to be committed and/or turned into a PR.

The script uses curl and python, with the python sys and json modules/libraries (in case they are not in the default CI running image...)

For generating PRs also have a look at the workflows for update and versioning automation in the CUPS Snap repo.

@rudra-iitm @gativarshney @rkt0209 could somebody of you have a look?

Activity

  1. hissamshar commented on Aug 18, 2026

    @hissamshar
    Contributor

    I've looked into this, including the full thread on #223. If nobody's already on it, I'm happy to put together a PR. Here's my plan:

    Approach: add a new .github/workflows/update-driverless.yml that runs driverless/update-printer-list.sh on a schedule and opens a PR via peter-evans/create-pull-request@v8. Nothing extra needs installing: curl and python3 are already on ubuntu-latest (the script falls back to python3 when python is absent), and the Python helpers only use sys/json.

    Schedule: monthly, cron: '0 6 1 * *' (1st of the month, 06:00 UTC), plus workflow_dispatch for manual runs. This matches how often the list is refreshed today.

    PR vs direct commit: going with a PR so changes get reviewed before deploy. I'll use the default GITHUB_TOKEN with permissions: { contents: write, pull-requests: write }, so no secret to provision. The one trade-off: a PR opened with GITHUB_TOKEN won't trigger the build.yml PR workflow, so the auto-PR won't show CI status. That's fine here because driverless.json is a static asset that build.yml doesn't validate (it's just copied into the build output), and the merge to master still triggers the Pages deploy.

    Safety guard: #223 happened after the update script broke (the script went missing and Apple's portal changed), which emptied the list. To make sure a failure can't silently wipe it again, I'll add a validation step that parses the JSON and asserts a plausible entry count before creating the PR. If the upstream fetch fails or the list comes back empty, the workflow stops and no PR is opened.

    I'll use cups-snap's auto-update.yml as the reference pattern, as suggested. Happy to adjust the approach if you'd like anything different

  2. michaelrsweet commented on Aug 18, 2026

    @michaelrsweet
    Member

    @hissamshar That all sounds perfect, thanks!

  3. tillkamppeter commented on Aug 18, 2026

    @tillkamppeter
    MemberAuthor

    All OK with me, please go ahead, @hissamshar .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions