Forgejo Pull Request 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 any time a Forgejo pull request is opened, synchronized, or reopened.

on:
  forgejo:
    pull-request:

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

on:
  forgejo:
    pull-request:
      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 pull request triggers:

PathDescription
event.git.shaThe SHA of the commit that triggered the event.
event.git.refThe ref of the pull request.
event.forgejo.pull-request.actionThe action that triggered the event (opened, synchronize, reopened, closed).
event.forgejo.pull-request.pull_request.numberThe number of the pull request.
event.forgejo.pull-request.pull_request.titleThe title of the pull request.
event.forgejo.pull-request.pull_request.html_urlThe URL of the pull request.
event.forgejo.pull-request.pull_request.head.refThe source branch of the pull request.
event.forgejo.pull-request.pull_request.head.shaThe SHA of the pull request head commit.
event.forgejo.pull-request.pull_request.user.loginThe login of the pull request author.
event.forgejo.pull-request.repository.idThe ID of the Forgejo repository.
event.forgejo.pull-request.repository.full_nameThe full name of the repository (e.g., org/project).
event.forgejo.pull-request.repository.html_urlThe web URL of the repository.
event.forgejo.pull-request.sender.loginThe login of the user who triggered the event.

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

Actions

By default, RWX fires the pull request trigger on [opened, synchronize, reopened]. If you only want to handle certain actions, you can specify them:

on:
  forgejo:
    pull-request:
      actions: [opened]

See Forgejo's documentation on pull request events for a full list of available actions.