I’ve written a fair bit about Tekton, but one of the perennial problems that I hear from users is that they can’t expose an event-listener to the internet.

Yes, opening firewall ports in the modern enterprise is often a trial of patience, so exposing your Tekton EventListener to GitHub is often not possible.

For this reason, I created tekton-poller-operator.

It’s not a perfect replacement for an EventListener, but if you want to drive Pipelines then this might help you!.

This is still in early stages, so I’m looking for feedback.

The obligatory YAML

apiVersion: polling.tekton.dev/v1alpha1
kind: Repository
metadata:
  name: example-repository
spec:
  url: https://github.com/my-org/my-repo.git
  ref: main
  frequency: 5m
  type: github # can also be gitlab
  pipelineRef:
    name: github-poll-pipeline
    namespace: test-ns # optional: if provided, the pipelinerun will be created in this namespace to reference the pipeline.
    params:
    - name: sha
      expression: commit.sha
    - name: repoURL
      expression: repoURL

This defines a Repository, every 5m, the GitHub repo https://github.com/myorg/my-repo.git is polled, if the SHA changes, then the pipeline github-poll-pipeline is executed with the new SHA, and the repoURL.

Params

params:
- name: sha
  expression: commit.sha
- name: repoURL
  expression: repoURL

The expressions here are CEL expressions, these are parsed from the commit that’s fetched by the Poller.

The repoURL is the URL from the spec in the repository, and the commit is the JSON body of the commit that was fetched.

TriggerBindings and TriggerTemplates

Currently, these are not supported, it will take some refactoring of Tekton triggers to make this happen, but this is the goal.