16 Commits

Author SHA1 Message Date
Anand Kumria 3cba608bb1 fix(git): surface GitHub GH013 ruleset rejections as config errors (#44819)
When GitHub returns 'GH013: Repository rule violations found' during
a push, the failure is currently silently swallowed by handleCommitError
whenever the changeset touches a file under .github/workflows/. The
existing swallow was intended for the narrow case of an App token
missing the 'workflows' scope, but it also masks unrelated ruleset
violations such as:

  - GITHUB PUSH PROTECTION 'File path is restricted'
  - Secret scanning push protection
  - Signed commit / branch-naming / tag-deletion rulesets

Self-hosted operators cannot see these failures in aggregated log
reports because Renovate logs at info level, marks the branch as
aborted, and continues. Repositories that are effectively 100%
blocked by a ruleset appear healthy.

Detect the 'GH013' token before the workflow-files silent-swallow and
throw a CONFIG_VALIDATION error - mirroring the treatment already
applied to GH003 (force-push denied) and 'protected branch hook
declined'. This flags the repository as failing, populates
validationError / validationMessage so the failure reason is visible
in the repository summary, and lets any downstream reporting pick it
up as a real failure instead of an info-level abort.

Adds tests to lib/util/git/errors.spec.ts covering:

  1. A GH013 Push Protection error whose changeset is entirely under
     .github/workflows/ is thrown as CONFIG_VALIDATION with the
     expected validationSource / validationError / validationMessage.

  2. A generic non-GH013 workflow-file remote rejection still returns
     null (existing swallow behaviour preserved).
2026-07-24 09:08:04 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
Michael Kriese 050ac8d23b chore: better code coverage (#39518) 2025-11-25 15:01:54 +00:00
RahulGautamSingh 49fa1be464 feat(util): getEnv (#35161)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-06 18:37:28 +00:00
Michael Kriese 4f60a8b7fe test: mock git globally (#34783) 2025-03-13 15:48:02 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Philip bece5a1c50 refactor(errors): massaging validation messages before we assign it (#25452)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-10-31 13:46:55 +00:00
Rhys Arkins 4288293eec fix(github): loosen bulk changes error detection
Fixes #24490
2023-10-07 07:56:59 +02:00
Sergei Zharinov 66d1ae94d3 refactor(git): Rename fetchCommit to fetchBranch (#21581) 2023-04-18 19:30:05 +00:00
Colin O'Dell 5375933cea feat(git): prune branches sequentially (#18068) 2022-10-02 05:56:52 +00:00
Rhys Arkins 1b20602682 fix(git): treat git 403 as external host error (#14981) 2022-04-06 07:47:56 +00:00
Rhys Arkins 00c74a9ca2 fix(git): treat stale rejection as REPOSITORY_CHANGED (#14829) 2022-03-28 17:44:40 +02:00
Oleg Krivtsov 536fd7366f feat(util): add gitFs retry wrapper (#13314) 2022-02-17 05:57:26 +00:00
Sergei Zharinov 1f79f22e47 fix(util/git): Skip PR update on "force-with-lease" errors (#14228) 2022-02-15 07:27:30 +00:00
Jamie Magee 3b7e9a17cb refactor: set importsNotUsedAsValues to error (#14052) 2022-02-07 06:37:17 +00:00
Sergei Zharinov fbb0a01f15 refactor(git): Extract error handling to separate file (#13819) 2022-01-26 05:52:06 +01:00