Forgejo Push Trigger

See Forgejo Triggers for an overview and Event Triggers for generic options like title, target, and if.

Placing the following snippet at the top of an RWX file will result in all tasks in the file running on every Forgejo push.

on:
  forgejo:
    push:

It's common to pass values from the event as init parameters into tasks.

on:
  forgejo:
    push:
      init:
        commit-sha: ${{ event.git.sha }}

base:
  image: ubuntu:24.04
  config: rwx/base 1.0.2

tasks:
  - key: code
    call: git/clone 2.0.7
    with:
      repository: [email protected]:YOUR_ORG/YOUR_REPO.git
      ref: ${{ init.commit-sha }}
      ssh-key: ${{ forgejo['YOUR_ORG/YOUR_REPO'].ssh-key }}

Event Fields

The following values are available in the event context for Forgejo push triggers:

PathDescription
event.git.shaThe SHA of the commit that triggered the event.
event.git.refThe ref that was pushed (e.g., refs/heads/main).
event.forgejo.push.afterThe SHA of the commit after the push.
event.forgejo.push.refThe ref that was pushed.
event.forgejo.push.repository.idThe ID of the Forgejo repository.
event.forgejo.push.repository.full_nameThe full name of the repository (e.g., org/project).
event.forgejo.push.repository.html_urlThe web URL of the repository.
event.forgejo.push.pusher.usernameThe username of the user who pushed.
event.forgejo.push.sender.loginThe login of the user who triggered the event.

For all values available in the event.forgejo context for Forgejo push triggers, see Forgejo's documentation on webhooks.