This demonstrates using the Forgejo API to let a workflow in one repository (from) dispatch a workflow in another (to).
Setup
An access token scoped with write:repository permissions must first be created:

Then, add it as a secret named PAT in the from repository.
(make sure Actions are enabled in both repos)
"From" workflow
# .forgejo/workflows/trigger.yaml
name: Trigger remote
# trigger for all pushes, adjust accordingly
on:
push:
env:
SERVER_URL: "git.example.com"
TARGET_BRANCH: "main"
TARGET_REPO: "to"
TARGET_REPO_OWNER: "username"
WORKFLOW_FILE: "remote.yaml"
jobs:
trigger:
runs-on: runner-name
steps:
- name: Remote trigger
run: |
curl -X 'POST' \
'https://${{ env.SERVER_URL }}/api/v1/repos/${{ env.TARGET_REPO_OWNER }}/${{ env.TARGET_REPO }}/actions/workflows/${{ env.WORKFLOW_FILE }}/dispatches' \
-H 'Accept: application/json' \
-H 'Authorization: token ${{ secrets.PAT }}' \
-H 'Content-Type: application/json' \
-d '{"ref": "${{ env.TARGET_BRANCH }}"}'
"To" workflow
# .forgejo/workflows/remote.yaml
name: Triggered workflow
# trigger from API dispatch
on:
repository_dispatch:
jobs:
execute:
runs-on: runner-name
steps:
- name: Remotely triggered
run: |
echo "This was triggered remotely"