styleproof 4.4.13 → 4.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.4.14] - 2026-07-13
11
+
12
+ ### Fixed
13
+
14
+ - **Workflow-token publication now uses Git's credential protocol for the final retry.**
15
+ The token stays out of remote URLs and process arguments, while real Git credential
16
+ lookup is covered directly instead of relying on an executable askpass script.
17
+
10
18
  ## [4.4.13] - 2026-07-13
11
19
 
12
20
  ### Fixed
@@ -47,6 +47,7 @@ export interface CachedCaptureDirs {
47
47
  compatibilityKey: string;
48
48
  tmpRoot: string;
49
49
  }
50
+ export declare function workflowTokenCredentialArguments(): string[];
50
51
  /** Record the real browser build into the capture dir. Called from a capture run, where a
51
52
  * Playwright browser handle is in scope. Write-or-CLEAR semantics: an undefined version
52
53
  * REMOVES any existing sidecar rather than leaving it, so a reused capture dir (e.g. the
package/dist/map-store.js CHANGED
@@ -52,6 +52,10 @@ function gitProcessEnvironment() {
52
52
  function runGit(cwd, args, maxBuffer = 1 << 28) {
53
53
  return spawnSync('git', args, { cwd, encoding: 'utf8', maxBuffer, env: gitProcessEnvironment() });
54
54
  }
55
+ const WORKFLOW_TOKEN_CREDENTIAL_HELPER = '!f() { if [ "$1" = get ]; then printf \'%s\\n\' username=x-access-token "password=$STYLEPROOF_MAP_STORE_TOKEN"; fi; }; f';
56
+ export function workflowTokenCredentialArguments() {
57
+ return ['-c', 'credential.helper=', '-c', `credential.helper=${WORKFLOW_TOKEN_CREDENTIAL_HELPER}`];
58
+ }
55
59
  function parseGitHttpExtraHeaders(configuredHeaders) {
56
60
  return configuredHeaders
57
61
  .split('\n')
@@ -486,33 +490,27 @@ function pushMapStoreCommit(cwd, temporaryCheckout, remote, branch, authenticati
486
490
  return isolatedPush;
487
491
  const mapStoreToken = process.env.STYLEPROOF_MAP_STORE_TOKEN;
488
492
  if (mapStoreToken) {
489
- const askpassDirectory = fs.mkdtempSync(path.join(os.tmpdir(), 'styleproof-map-store-askpass-'));
490
- const askpassScript = path.join(askpassDirectory, 'askpass.sh');
491
- fs.writeFileSync(askpassScript, '#!/bin/sh\ncase "$1" in *Username*) printf "%s\\n" x-access-token ;; *) printf "%s\\n" "$STYLEPROOF_MAP_STORE_TOKEN" ;; esac\n', { mode: 0o700 });
492
- try {
493
- const askpassPush = spawnSync('git', [
494
- '-c',
495
- `${['http.https:', '', 'github.com', '.extraheader'].join('/')}=`,
496
- 'push',
497
- '-q',
498
- 'origin',
499
- `HEAD:${branch}`,
500
- ], {
501
- cwd: temporaryCheckout,
502
- encoding: 'utf8',
503
- maxBuffer: 1 << 20,
504
- env: {
505
- ...gitProcessEnvironment(),
506
- GIT_ASKPASS: askpassScript,
507
- GIT_TERMINAL_PROMPT: '0',
508
- },
509
- });
510
- if (askpassPush.status === 0)
511
- return askpassPush;
512
- }
513
- finally {
514
- fs.rmSync(askpassDirectory, { recursive: true, force: true });
515
- }
493
+ const githubExtraHeaderKey = ['http.https:', '', 'github.com', '.extraheader'].join('/');
494
+ runGit(temporaryCheckout, ['config', '--local', '--unset-all', githubExtraHeaderKey], 1 << 20);
495
+ const credentialPush = spawnSync('git', [
496
+ '-c',
497
+ `${githubExtraHeaderKey}=`,
498
+ ...workflowTokenCredentialArguments(),
499
+ 'push',
500
+ '-q',
501
+ 'origin',
502
+ `HEAD:${branch}`,
503
+ ], {
504
+ cwd: temporaryCheckout,
505
+ encoding: 'utf8',
506
+ maxBuffer: 1 << 20,
507
+ env: {
508
+ ...gitProcessEnvironment(),
509
+ GIT_TERMINAL_PROMPT: '0',
510
+ },
511
+ });
512
+ if (credentialPush.status === 0)
513
+ return credentialPush;
516
514
  }
517
515
  const mapStoreCommit = gitOutput(temporaryCheckout, ['rev-parse', 'HEAD']);
518
516
  const importCommit = runGit(cwd, ['fetch', '-q', '--no-write-fetch-head', temporaryCheckout, mapStoreCommit], 1 << 20);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styleproof",
3
- "version": "4.4.13",
3
+ "version": "4.4.14",
4
4
  "description": "Catch every CSS change before it ships — review PRs and certify refactors by the browser's computed styles, not pixels. Works with any styling system.",
5
5
  "keywords": [
6
6
  "playwright",