- one PR workflow (plugin-checks) with version-changelog, package, phpunit jobs - .gitea/actions/package: package + validate + assert, used by PR and release - phpunit: FORCE_INSTALL so the TestBootstrapper installs its own test DB - protect-main.sh: required context is now plugin-checks / version-changelog Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
17 lines
673 B
Bash
Executable File
17 lines
673 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# One-time (re-runnable) setup: require the PR checks on `main` using the Gitea `tea` CLI.
|
|
# `tea branches protect` cannot set status-check contexts, hence `tea api`.
|
|
# Usage: scripts/protect-main.sh [owner/repo] (default: derived from the git remote)
|
|
set -euo pipefail
|
|
|
|
REPO="${1:-$(git config --get remote.origin.url | sed -E 's#^.*[:/]([^/]+/[^/]+)$#\1#; s#\.git$##')}"
|
|
|
|
tea api -X PATCH "repos/${REPO}/branch_protections/main" -d '{
|
|
"enable_status_check": true,
|
|
"status_check_contexts": [
|
|
"plugin-checks / version-changelog (pull_request)",
|
|
"plugin-checks / package (pull_request)",
|
|
"plugin-checks / phpunit (pull_request)"
|
|
]
|
|
}'
|