- Shell 100%
|
|
||
|---|---|---|
| hooks | ||
| scripts | ||
| .gitignore | ||
| issue.schema.json | ||
| README.md | ||
wulf-dev
Shared local developer tooling — git hooks and Forgejo helper scripts — consumed as a git submodule so it lives in one place instead of being copied (and re-broken) per repo.
This is the local/developer counterpart to
ci-actions:
ci-actions runs in Forgejo Actions (referenced by uses: tag); wulf-dev runs
on a developer's machine from a checkout (referenced as a submodule).
Contents
| Path | What it does |
|---|---|
hooks/pre-commit |
Blocks direct commits to main. |
hooks/pre-push |
Rejects any unsigned commit in what's being pushed. |
scripts/install-hooks.sh |
Points the consuming repo's core.hooksPath at hooks/. |
scripts/pr.sh |
Opens a Forgejo PR from the current (or given) branch. |
scripts/issue-new.sh |
Creates the next issues/NNNN.yaml from the template. |
scripts/issue-validate.sh |
Validates issues/*.yaml against issue.schema.json. |
scripts/lib.sh |
Shared helpers (repo_root, yaml_dq); sourced, not executed. |
issue.schema.json |
Canonical contract for the issue-file format (shipped here, defined once). |
Every script operates on the consuming (super)project, not on this
submodule — repo_root resolves the superproject working tree, so .env and
issues/ are read from the repo that embeds wulf-dev. The issue format,
by contrast, is defined once here (issue.schema.json) rather than per repo.
Consuming it
From the root of a repo that should use this tooling:
git submodule add https://forgejo.wulf.science/WulfScience-FOSS/wulf-dev.git modules/wulf-dev
bash modules/wulf-dev/scripts/install-hooks.sh
Invoke the scripts by their submodule path (there are no wrappers):
bash modules/wulf-dev/scripts/pr.sh --title "..."
bash modules/wulf-dev/scripts/issue-new.sh "Title" [--type bug] [--milestone "..."]
bash modules/wulf-dev/scripts/issue-validate.sh
Requirements in the consuming repo
pr.sh—jq+curl, and a gitignored.envat the repo root:FORGEJO_URL=https://forgejo.wulf.science FORGEJO_OWNER=... FORGEJO_REPO=... FORGEJO_TOKEN=...issue-validate.sh—yq+jq(the CI tools image stdlib). The schema it validates against ships with this submodule (issue.schema.json), so there's nothing to add per repo.pre-push— SSH commit signing configured (gpg.format ssh+gpg.ssh.allowedSignersFile); otherwise a genuinely-signed commit reports%G?=Eand the push is rejected. Per-repo signing setup lives in the Standard template repo, not here.