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:
| Path | Description |
|---|---|
event.git.sha | The SHA of the commit that triggered the event. |
event.git.ref | The ref that was pushed (e.g., refs/heads/main). |
event.forgejo.push.after | The SHA of the commit after the push. |
event.forgejo.push.ref | The ref that was pushed. |
event.forgejo.push.repository.id | The ID of the Forgejo repository. |
event.forgejo.push.repository.full_name | The full name of the repository (e.g., org/project). |
event.forgejo.push.repository.html_url | The web URL of the repository. |
event.forgejo.push.pusher.username | The username of the user who pushed. |
event.forgejo.push.sender.login | The 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.