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%
|
All checks were successful
test / unit (push) Successful in 5s
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. |
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| tests | ||
| .gitignore | ||
| action.yml | ||
| CHANGELOG.md | ||
| LICENSE | ||
| Makefile | ||
| MIGRATION.md | ||
| README.md | ||
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/checkoutso there's a repo to work in. permissions: contents: write(push the branch) andpull-requests: write(open the PR).
See MIGRATION.md for differences from
peter-evans/create-pull-request.
License
MIT, see LICENSE.