Forgejo drop-in for peter-evans/create-pull-request: commit changes to a branch, push, and open or update a PR via the Forgejo API.
  • JavaScript 73.4%
  • Shell 20.5%
  • Makefile 6.1%
Find a file
Stephen Way 37852255ec
All checks were successful
test / unit (push) Successful in 5s
Initial release: create-pull-request-action
Commit working-tree changes to a branch, push, and open or update a PR
via the Forgejo API. A drop-in for peter-evans/create-pull-request with
no github.com. No changes -> no-op; re-running the same branch
force-updates it and updates the existing PR instead of duplicating.

node20 action: git ops shell out to the runner's git, the PR is
created/updated through the Forgejo API (labels matched by name).
Offline suite covers create/no-change/update/labels against a fake git
and an in-memory mock API.
2026-05-31 19:59:53 -07:00
.forgejo/workflows Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
src Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
tests Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
.gitignore Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
action.yml Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
CHANGELOG.md Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
LICENSE Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
Makefile Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
MIGRATION.md Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00
README.md Initial release: create-pull-request-action 2026-05-31 19:59:53 -07:00

Create Pull Request (Forgejo)

Forgejo's peter-evans/create-pull-request. Take the changes in your workspace, commit them to a branch, push, and open or update a pull request, all through the Forgejo API. No github.com.

Part of the Fjord Actions bundle.

Usage

permissions:
  contents: write
  pull-requests: write

jobs:
  bump:
    runs-on: [self-hosted, Linux]
    steps:
      - uses: actions/checkout@v6

      - run: ./scripts/update-deps.sh    # makes whatever changes you want in the tree

      - uses: https://rasterhub.com/rasterstate/create-pull-request-action@v1
        with:
          branch: deps/weekly
          title: 'chore(deps): weekly bump'
          commit-message: 'chore(deps): weekly bump'
          body: Automated dependency update.
          labels: automated, deps
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}   # a Forgejo token on Forgejo

If there are no changes in the tree, the action is a no-op (pull-request-operation = none). Re-running with the same branch force-updates the branch and updates the existing PR rather than opening a duplicate.

Inputs

Input Default Description
branch create-pull-request/patch Head branch to create/update.
base repo default branch Branch to merge into.
title commit message PR title.
body PR body.
commit-message Automated changes Commit message for the staged changes.
add-paths all (git add -A) Paths to stage, one per line.
labels Labels for a new PR, comma/newline separated (by name).
draft false Open as a draft (WIP: title prefix on Forgejo).
author-name GITHUB_ACTOR Git author/committer name.
author-email Git author/committer email.
path . Working directory of the repo.
token GITHUB_TOKEN env Forgejo token with repo write.
repository GITHUB_REPOSITORY Target repo owner/name.
api_url derived Forgejo API base.

Outputs

Output Description
pull-request-number PR number (empty when there were no changes).
pull-request-url PR web URL.
pull-request-operation created / updated / none.
pull-request-branch Head branch that was pushed.
pull-request-head-sha Commit SHA pushed to the head branch.

Requirements

  • Run after actions/checkout so there's a repo to work in.
  • permissions: contents: write (push the branch) and pull-requests: write (open the PR).

See MIGRATION.md for differences from peter-evans/create-pull-request.

License

MIT, see LICENSE.