Commit Graph

98 Commits

Author SHA1 Message Date
Michael B. Gale
a440e35eda Move ActionsEnvVars to environment.ts 2026-07-09 12:48:49 +01:00
Michael B. Gale
732911a2fa Turn Env into a class, and add ReadOnlyEnv 2026-07-09 12:38:40 +01:00
Michael B. Gale
5e3e6b81b9 Add ActionsEnvVars enum 2026-07-06 12:27:26 +01:00
Henry Mercer
6feed5452f Categorize Code Quality "not enabled" upload failure as user-error
When a repository requests Code Quality analysis but it is not enabled,
the SARIF upload to `PUT /repos/:owner/:repo/code-quality/analysis`
returns a 403 with the message "Code quality is not enabled for this
repository...". `isEnablementError` did not recognize this wording, so
`wrapApiConfigurationError` left it as a plain Error and the analyze job
was reported with `status=failure` instead of `user-error`.

Add a `/Code Quality is not enabled/i` pattern so the error becomes a
ConfigurationError and `getActionsStatus` categorizes it as `user-error`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-23 16:23:41 +01:00
Henry Mercer
f64a4491cf Add links to API docs 2026-05-05 18:48:09 +01:00
Henry Mercer
5997e25ad9 Update listActionsCaches doc 2026-05-05 18:43:01 +01:00
Henry Mercer
7587714d0a Revert "Mitigate caches being evicted before they can be downloaded"
This reverts commit 1279e8d41c.
2026-05-05 18:37:17 +01:00
Henry Mercer
1279e8d41c Mitigate caches being evicted before they can be downloaded 2026-04-22 00:04:57 +01:00
Henry Mercer
13c548978d Fix retries when uploading databases 2026-03-10 12:34:18 +00:00
Henry Mercer
43b46a19be Retry API authentication errors since these can be transient 2026-02-12 16:19:04 +00:00
Henry Mercer
6d4cd5d744 Add "Requires authentication" to wrapApiConfigurationError 2026-02-02 18:02:11 +00:00
Michael B. Gale
d5b3d42fd4 Inline EnvVar.ANALYSIS_KEY in getAnalysisKey 2026-01-21 12:52:24 +00:00
Michael B. Gale
055e6b6f36 Add EnvVar constant for analysis key 2026-01-19 13:41:38 +00:00
Henry Mercer
1fc7d3785d Rename GHE_DOTCOM to GHEC_DR
This more closely reflects the published naming https://docs.github.com/en/enterprise-cloud@latest/admin/data-residency/about-github-enterprise-cloud-with-data-residency
2025-12-10 17:41:19 +00:00
Henry Mercer
cac5926de5 Delete unused exports 2025-11-18 18:16:54 +00:00
Michael B. Gale
f0e9bf07f4 Make isEnablementError case-insensitive 2025-10-30 11:37:07 +00:00
Michael B. Gale
52a7bd7b6e Check for 403 status 2025-10-29 08:35:19 +00:00
Michael B. Gale
194ba0ee2d Make error message tests less brittle 2025-10-29 08:29:11 +00:00
Michael B. Gale
53acf0b8aa Turn enablement errors into configuration errors 2025-10-28 21:17:30 +00:00
Henry Mercer
3d988b275a Pass minimal copy of core 2025-10-28 16:33:21 +00:00
Henry Mercer
8b1e55d11e Use Actions logger in API client
This allows us to remove the `console-log-level` dependency.
2025-10-28 12:15:03 +00:00
Henry Mercer
e6e649a8f3 Simplify API error checks 2025-10-21 10:31:53 +01:00
Henry Mercer
c64c4070cc Handle HTTP errors with httpStatusCode property 2025-10-20 14:38:02 +01:00
Michael B. Gale
e6768a18cf Merge branch 'main' into mbg/dep-caching/telemetry 2025-09-29 08:39:48 +01:00
Michael B. Gale
6ccec2ac14 Remove url from log messages 2025-09-24 18:54:49 +01:00
Michael B. Gale
4e820a4ca4 Apply review feedback 2025-09-24 15:50:19 +01:00
Michael B. Gale
efcf614b5d Refactor assembling Authorization header value into its own function 2025-09-24 12:40:15 +01:00
Michael B. Gale
7dfbfdcb01 Report overall cache usage for CodeQL dependency caches 2025-09-23 12:28:42 +01:00
Michael B. Gale
40262b1861 Add getRepositoryProperties to api-client, for easier mocking 2025-09-23 09:11:10 +01:00
Fotis Koutoulakis (@NlightNFotis)
55ee663d5f review-comments: refactor getActionsStatus to accept an extra parameter designating if the analysis is third-party 2025-04-01 14:58:59 +01:00
Fotis Koutoulakis (@NlightNFotis)
a022653e2d feat: classify more HTTP errors as configuration errors in api-client 2025-03-31 11:54:16 +01:00
Fotis Koutoulakis (@NlightNFotis)
73c938dbc0 fix: fix issue where wrapApiConfigurationError would fail to regex match a string due to boundary constraints on the regex 2025-03-28 14:38:06 +00:00
Chuan-kai Lin
f88459c0a3 Use getRepositoryNwo() 2025-03-26 10:18:40 -07:00
nickfyson
7b7ed63503 adjust string for handling rate limit error 2025-03-06 10:33:25 +00:00
Marco Gario
ddd849e831 fix lint 2024-07-01 12:14:01 +00:00
Marco Gario
0ff1bdba7f Update src/api-client.ts
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2024-07-01 11:01:12 +02:00
Marco Gario
37b6ead477 Better handling for required workflows
Return the workflow path from the run rather than trying to fetch the workflow
information when the workflow information is missing or refers to a required workflow.
2024-06-27 16:24:26 +00:00
Henry Mercer
1ea11ca775 Enable no-unsafe-return rule 2024-06-13 19:52:39 +01:00
Henry Mercer
e7d04fdb41 Enable unsafe call rule 2024-06-13 19:38:06 +01:00
Henry Mercer
610e72285f Clean up old TRAP caches 2024-05-23 16:27:50 +01:00
Henry Mercer
898dead2d6 Use automatic pagination mapping function 2024-05-23 16:27:50 +01:00
Henry Mercer
1bea17f717 Log key and ref for which we're retrieving caches 2024-05-23 16:27:50 +01:00
Henry Mercer
087f0b04c6 Restrict TRAP cache cleanup to analyzed language 2024-05-21 22:28:59 +01:00
Henry Mercer
cc96c825ba List matching Actions caches 2024-05-21 22:27:49 +01:00
Henry Mercer
a22989dcd4 Mark commit not found as a user error too 2024-04-15 13:14:52 +01:00
Henry Mercer
fa75c144b4 Capture rate limit and ref not existing config errors 2024-04-12 18:25:10 +01:00
Henry Mercer
415881f4cf Remove code specific to GitHub AE 2024-01-08 13:28:39 +00:00
Henry Mercer
c6d284324b Pull out a dedicated status report file 2023-08-07 16:13:59 +01:00
Angela P Wen
b16296be30 Auto-fix linting errors 2023-07-25 10:34:21 +02:00
Henry Mercer
2637069a45 Resolve dependency cycles between actions-util and workflow 2023-07-19 17:21:33 +01:00