Previously, when Gitea is installed with DISABLE_GIT_HOOKS=true (the
default), every git-hook API call returned 403 and the script:
- marked every repository as FAILED, and
- never counted the hook step at all.
This change detects the disabled state up front with a single probe
against the first editable repo:
- If hooks are disabled, it prints a clear notice, skips the pre-receive
step for every repo (branch/tag protection still runs normally), and
exits non-zero (2) so automation notices the run is partial.
- A per-repo 403 on the hook step is isolated (HookNotWritable) so it no
longer clobbers the whole repo into FAILED -- branch/tag still apply,
and the hook reports 'SKIPPED (git hooks not writable)'.
- Adds a Hooks skipped counter and distinguishes 'disabled' vs
'not writable' in the summary.
- Fixes an UnboundLocalError on the 'no editable repos' path by
initializing hooks_enabled before the probe.
Verified end-to-end against a mock Gitea API for both scenarios (hooks
disabled -> skip + exit 2; hooks enabled -> exact/stale/missing handled
correctly, exit 0).
Adds pre-receive hook management to the existing hardening script:
- Defines GIT_HOOKS with the canonical guard content (rejects workflow
changes arriving via untrusted branches) from pre-receive-guard.sh.
- Reads the current hook via the git-hook API; treats is_active=false
as not set.
- Sets/updates the hook via PATCH only when the content differs, using
exact-match comparison (Gitea stores hook content verbatim).
- Mirrors the existing branch/tag protection reporting (dry-run vs
--apply) and adds hooks to the summary counters.
- Skips archived repos and surfaces API failures like the rest of the
script.
33e0d2a CI: add NSOLID to the CI tests
a9dab9a CI: add NSOLID to the CI tests
b84e562 Update scripts to support new NSOLID version
7925aa5 Add node25 scripts
612077e Merge pull request #1890 from nodesource/alejo/fix-distributions
2e44c74 ci(rocky): use official Rocky mirrorlist and tolerate unavailable mirrors
904ee90 fix: update apt 3.0.0 (amd64) [#1874] (#1875)
044f89b doc: update docs
git-subtree-dir: nodesource
git-subtree-split: 33e0d2ac2a5421d45bfd9b9fdf04c1fcab35246b
f252ea6 Revise OS compatibility section in README
90d4f7a Fix download URL and add auto-detection of latest Go version (#75)
a9cb3b4 Update to Go 1.24.4 (#74)
git-subtree-dir: golang-install
git-subtree-split: f252ea6773ae636e82f60a147111029c4defdc63