Forgejo Triggers

RWX can trigger runs based on Forgejo events. Before configuring triggers, ensure you've followed the getting started with Forgejo guide.

For generic trigger options like title, target, if, and start, see Event Triggers.

Push Triggers

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:

For detailed documentation including event fields, see Forgejo Push Trigger Reference.

Pull Request Triggers

Placing the following snippet at the top of an RWX file will result in all tasks in the file running any time a Forgejo pull request is opened, synchronized, or reopened.

on:
  forgejo:
    pull-request:

For detailed documentation including event fields and available actions, see Forgejo Pull Request Trigger Reference.

Common Patterns

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 }}

Reference Pages