@reddoorla/maintenance 0.82.0 → 0.83.0
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/dist/airtable-5ZPU3MT4.js +9 -0
- package/dist/{announce-7QHQGJPV.js → announce-4H64L2Z6.js} +4 -4
- package/dist/{blux-EATHOHKK.js → blux-ZGDSHI3U.js} +5 -5
- package/dist/{bump-deps-ZREAMK7M.js → bump-deps-2OL6PGTM.js} +5 -5
- package/dist/{chunk-OIDDJLS7.js → chunk-2WN4SNBQ.js} +2 -2
- package/dist/{chunk-HVOOCK6L.js → chunk-4DHQCN5H.js} +2 -1
- package/dist/{chunk-5E4L7WKE.js → chunk-5P2HVNLZ.js} +3 -3
- package/dist/{chunk-ZXRRKKMR.js → chunk-6V7565O2.js} +8 -8
- package/dist/{chunk-YRM6EED7.js → chunk-CLWNAMUX.js} +28 -2
- package/dist/chunk-CLWNAMUX.js.map +1 -0
- package/dist/{chunk-VXXF4Y25.js → chunk-FSRJAF2Q.js} +60 -3
- package/dist/chunk-FSRJAF2Q.js.map +1 -0
- package/dist/{chunk-B5ZUQZFL.js → chunk-ICXV25N7.js} +2 -2
- package/dist/{chunk-UH5YPYS4.js → chunk-JVWJJ36K.js} +5 -4
- package/dist/chunk-JVWJJ36K.js.map +1 -0
- package/dist/{chunk-4PW6ISX7.js → chunk-KV7DIRRO.js} +3 -3
- package/dist/{chunk-ODC4PXZL.js → chunk-MQUOUVQP.js} +2 -2
- package/dist/{chunk-LMCO7CYQ.js → chunk-OQFOMKBP.js} +2 -2
- package/dist/{chunk-FFI7P74K.js → chunk-PBCGXXG6.js} +2 -2
- package/dist/{chunk-T4FQ6TZT.js → chunk-QRDB4NLB.js} +6 -6
- package/dist/{chunk-K5JZ5KLO.js → chunk-R4AB6GCT.js} +3 -3
- package/dist/chunk-R53VL3RI.js +32 -0
- package/dist/chunk-R53VL3RI.js.map +1 -0
- package/dist/{chunk-FX7RAMGC.js → chunk-R6FPFMOS.js} +3 -3
- package/dist/{chunk-MGJ72BA4.js → chunk-RJB3QUSP.js} +2 -2
- package/dist/{chunk-ATJ6ZA2V.js → chunk-SDUJIANJ.js} +2 -2
- package/dist/{chunk-7ADQL5Y3.js → chunk-THEFTZ7F.js} +2 -2
- package/dist/{chunk-NT4WIP7I.js → chunk-UYCAF77E.js} +2 -2
- package/dist/chunk-VNB5XBQ4.js +699 -0
- package/dist/chunk-VNB5XBQ4.js.map +1 -0
- package/dist/{chunk-YAMRVXOD.js → chunk-VRWUL4TR.js} +2 -2
- package/dist/{chunk-2BHSGLWR.js → chunk-XDCRVYFL.js} +3 -3
- package/dist/chunk-XDCRVYFL.js.map +1 -0
- package/dist/{chunk-4NAOR44V.js → chunk-ZMIPG6TR.js} +2 -2
- package/dist/cli/bin.js +51 -23
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/commands/audit.d.ts +1 -1
- package/dist/cli/commands/audit.js +10 -10
- package/dist/{convert-to-pnpm-UT2R6EOW.js → convert-to-pnpm-KCXOYOHW.js} +5 -5
- package/dist/{digest-CLFUWW62.js → digest-WGEPAWMP.js} +12 -7
- package/dist/digest-WGEPAWMP.js.map +1 -0
- package/dist/{ensure-site-LLPOXLWP.js → ensure-site-HYAIVZY2.js} +2 -2
- package/dist/{forms-notify-target-PN6P3WPW.js → forms-notify-target-HSL4ZMT5.js} +2 -2
- package/dist/{github-signals-HTH7474O.js → github-signals-I7XACMCE.js} +6 -6
- package/dist/{header-image-WMHZFU7B.js → header-image-ADYPTGVY.js} +2 -2
- package/dist/{health-endpoint-4E53ZMLE.js → health-endpoint-JNCUILHO.js} +6 -6
- package/dist/index.d.ts +65 -3
- package/dist/index.js +32 -31
- package/dist/index.js.map +1 -1
- package/dist/{init-3ZJ7Z5NG.js → init-FLGLJCMJ.js} +13 -13
- package/dist/{launch-FRCDOB56.js → launch-AVKH2JVF.js} +10 -10
- package/dist/{lighthouse-airtable-I46QCEIS.js → lighthouse-airtable-CHANWVO6.js} +3 -3
- package/dist/{onboard-45NPDMMW.js → onboard-HF4FTJDE.js} +5 -5
- package/dist/{orchestrate-34JYNIXT.js → orchestrate-5FMNYJEA.js} +3 -3
- package/dist/{preflight-WVD32COX.js → preflight-HTWIX3MN.js} +4 -4
- package/dist/prismic-ci-BH225Q4L.js +363 -0
- package/dist/prismic-ci-BH225Q4L.js.map +1 -0
- package/dist/prismic-models-HXCAM4ZL.js +1020 -0
- package/dist/prismic-models-HXCAM4ZL.js.map +1 -0
- package/dist/{protection-audit-2UR45SOC.js → protection-audit-64PLLBLI.js} +3 -3
- package/dist/recipes/sync-configs.d.ts +1 -1
- package/dist/{renovate-dispatch-LOOCNZTW.js → renovate-dispatch-HBZG2UEU.js} +4 -4
- package/dist/{report-CLF2753O.js → report-LV7NY5W3.js} +20 -13
- package/dist/report-LV7NY5W3.js.map +1 -0
- package/dist/{self-updating-5TJ2NB26.js → self-updating-4Q65OVXY.js} +6 -6
- package/dist/{selftest-BTCZLCTL.js → selftest-K5XZKVTE.js} +7 -7
- package/dist/{smoke-suite-GHKXMKIR.js → smoke-suite-J3LL3JZJ.js} +6 -6
- package/dist/{submissions-KUXLKCSQ.js → submissions-GMBUP4LV.js} +2 -2
- package/dist/{svelte-codemods-YTCTLK7G.js → svelte-codemods-JTMX4BSX.js} +4 -4
- package/dist/{sync-configs-KSSQZU5L.js → sync-configs-5DXSL64Q.js} +4 -4
- package/dist/{types-DnEL3NRn.d.ts → types-OIQZ5hWN.d.ts} +1 -1
- package/dist/{upgrade-UDAPY3SN.js → upgrade-HCR25P25.js} +5 -5
- package/dist/{websites-JXG3WWAU.js → websites-VITQ3WXN.js} +6 -2
- package/dist/{write-audits-to-airtable-7D3LV4KP.js → write-audits-to-airtable-3SOXLKJK.js} +4 -4
- package/package.json +1 -1
- package/dist/airtable-ZDHLKK5K.js +0 -9
- package/dist/chunk-2BHSGLWR.js.map +0 -1
- package/dist/chunk-KRDLHAKK.js +0 -17
- package/dist/chunk-KRDLHAKK.js.map +0 -1
- package/dist/chunk-UH5YPYS4.js.map +0 -1
- package/dist/chunk-VXXF4Y25.js.map +0 -1
- package/dist/chunk-YRM6EED7.js.map +0 -1
- package/dist/digest-CLFUWW62.js.map +0 -1
- package/dist/report-CLF2753O.js.map +0 -1
- /package/dist/{airtable-ZDHLKK5K.js.map → airtable-5ZPU3MT4.js.map} +0 -0
- /package/dist/{announce-7QHQGJPV.js.map → announce-4H64L2Z6.js.map} +0 -0
- /package/dist/{blux-EATHOHKK.js.map → blux-ZGDSHI3U.js.map} +0 -0
- /package/dist/{bump-deps-ZREAMK7M.js.map → bump-deps-2OL6PGTM.js.map} +0 -0
- /package/dist/{chunk-OIDDJLS7.js.map → chunk-2WN4SNBQ.js.map} +0 -0
- /package/dist/{chunk-HVOOCK6L.js.map → chunk-4DHQCN5H.js.map} +0 -0
- /package/dist/{chunk-5E4L7WKE.js.map → chunk-5P2HVNLZ.js.map} +0 -0
- /package/dist/{chunk-ZXRRKKMR.js.map → chunk-6V7565O2.js.map} +0 -0
- /package/dist/{chunk-B5ZUQZFL.js.map → chunk-ICXV25N7.js.map} +0 -0
- /package/dist/{chunk-4PW6ISX7.js.map → chunk-KV7DIRRO.js.map} +0 -0
- /package/dist/{chunk-ODC4PXZL.js.map → chunk-MQUOUVQP.js.map} +0 -0
- /package/dist/{chunk-LMCO7CYQ.js.map → chunk-OQFOMKBP.js.map} +0 -0
- /package/dist/{chunk-FFI7P74K.js.map → chunk-PBCGXXG6.js.map} +0 -0
- /package/dist/{chunk-T4FQ6TZT.js.map → chunk-QRDB4NLB.js.map} +0 -0
- /package/dist/{chunk-K5JZ5KLO.js.map → chunk-R4AB6GCT.js.map} +0 -0
- /package/dist/{chunk-FX7RAMGC.js.map → chunk-R6FPFMOS.js.map} +0 -0
- /package/dist/{chunk-MGJ72BA4.js.map → chunk-RJB3QUSP.js.map} +0 -0
- /package/dist/{chunk-ATJ6ZA2V.js.map → chunk-SDUJIANJ.js.map} +0 -0
- /package/dist/{chunk-7ADQL5Y3.js.map → chunk-THEFTZ7F.js.map} +0 -0
- /package/dist/{chunk-NT4WIP7I.js.map → chunk-UYCAF77E.js.map} +0 -0
- /package/dist/{chunk-YAMRVXOD.js.map → chunk-VRWUL4TR.js.map} +0 -0
- /package/dist/{chunk-4NAOR44V.js.map → chunk-ZMIPG6TR.js.map} +0 -0
- /package/dist/{convert-to-pnpm-UT2R6EOW.js.map → convert-to-pnpm-KCXOYOHW.js.map} +0 -0
- /package/dist/{ensure-site-LLPOXLWP.js.map → ensure-site-HYAIVZY2.js.map} +0 -0
- /package/dist/{forms-notify-target-PN6P3WPW.js.map → forms-notify-target-HSL4ZMT5.js.map} +0 -0
- /package/dist/{github-signals-HTH7474O.js.map → github-signals-I7XACMCE.js.map} +0 -0
- /package/dist/{header-image-WMHZFU7B.js.map → header-image-ADYPTGVY.js.map} +0 -0
- /package/dist/{health-endpoint-4E53ZMLE.js.map → health-endpoint-JNCUILHO.js.map} +0 -0
- /package/dist/{init-3ZJ7Z5NG.js.map → init-FLGLJCMJ.js.map} +0 -0
- /package/dist/{launch-FRCDOB56.js.map → launch-AVKH2JVF.js.map} +0 -0
- /package/dist/{lighthouse-airtable-I46QCEIS.js.map → lighthouse-airtable-CHANWVO6.js.map} +0 -0
- /package/dist/{onboard-45NPDMMW.js.map → onboard-HF4FTJDE.js.map} +0 -0
- /package/dist/{orchestrate-34JYNIXT.js.map → orchestrate-5FMNYJEA.js.map} +0 -0
- /package/dist/{preflight-WVD32COX.js.map → preflight-HTWIX3MN.js.map} +0 -0
- /package/dist/{protection-audit-2UR45SOC.js.map → protection-audit-64PLLBLI.js.map} +0 -0
- /package/dist/{renovate-dispatch-LOOCNZTW.js.map → renovate-dispatch-HBZG2UEU.js.map} +0 -0
- /package/dist/{self-updating-5TJ2NB26.js.map → self-updating-4Q65OVXY.js.map} +0 -0
- /package/dist/{selftest-BTCZLCTL.js.map → selftest-K5XZKVTE.js.map} +0 -0
- /package/dist/{smoke-suite-GHKXMKIR.js.map → smoke-suite-J3LL3JZJ.js.map} +0 -0
- /package/dist/{submissions-KUXLKCSQ.js.map → submissions-GMBUP4LV.js.map} +0 -0
- /package/dist/{svelte-codemods-YTCTLK7G.js.map → svelte-codemods-JTMX4BSX.js.map} +0 -0
- /package/dist/{sync-configs-KSSQZU5L.js.map → sync-configs-5DXSL64Q.js.map} +0 -0
- /package/dist/{upgrade-UDAPY3SN.js.map → upgrade-HCR25P25.js.map} +0 -0
- /package/dist/{websites-JXG3WWAU.js.map → websites-VITQ3WXN.js.map} +0 -0
- /package/dist/{write-audits-to-airtable-7D3LV4KP.js.map → write-audits-to-airtable-3SOXLKJK.js.map} +0 -0
|
@@ -2,30 +2,30 @@ import {
|
|
|
2
2
|
appendSkipNotice,
|
|
3
3
|
fleetWorkdir,
|
|
4
4
|
prepareFleetSites
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZMIPG6TR.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveSites
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MQUOUVQP.js";
|
|
9
9
|
import {
|
|
10
10
|
init
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-6V7565O2.js";
|
|
12
|
+
import "./chunk-UYCAF77E.js";
|
|
13
|
+
import "./chunk-RJB3QUSP.js";
|
|
13
14
|
import "./chunk-LS6QPANO.js";
|
|
14
15
|
import "./chunk-J7SZQUCW.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-NT4WIP7I.js";
|
|
16
|
+
import "./chunk-R6FPFMOS.js";
|
|
17
|
+
import "./chunk-R4AB6GCT.js";
|
|
18
|
+
import "./chunk-R53VL3RI.js";
|
|
19
19
|
import "./chunk-Q276MZ7E.js";
|
|
20
20
|
import "./chunk-73UFRZKY.js";
|
|
21
21
|
import "./chunk-ZTPPCHDB.js";
|
|
22
22
|
import "./chunk-OTGB6YQO.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-GASBX52O.js";
|
|
25
|
-
import "./chunk-YAMRVXOD.js";
|
|
23
|
+
import "./chunk-QRDB4NLB.js";
|
|
26
24
|
import "./chunk-LKGVSM2O.js";
|
|
25
|
+
import "./chunk-GASBX52O.js";
|
|
26
|
+
import "./chunk-VRWUL4TR.js";
|
|
27
27
|
import "./chunk-FDIFTIXC.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-4DHQCN5H.js";
|
|
29
29
|
import "./chunk-A3WDWNN5.js";
|
|
30
30
|
import "./chunk-2OP4JKIQ.js";
|
|
31
31
|
import {
|
|
@@ -107,4 +107,4 @@ async function runInitCommand(site, opts) {
|
|
|
107
107
|
export {
|
|
108
108
|
runInitCommand
|
|
109
109
|
};
|
|
110
|
-
//# sourceMappingURL=init-
|
|
110
|
+
//# sourceMappingURL=init-FLGLJCMJ.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selfUpdating
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-THEFTZ7F.js";
|
|
4
4
|
import "./chunk-MNDIED4M.js";
|
|
5
5
|
import {
|
|
6
6
|
writeAuditsToAirtable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XDCRVYFL.js";
|
|
8
8
|
import {
|
|
9
9
|
hasRealScores,
|
|
10
10
|
lighthouseScoresFromResult
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OQFOMKBP.js";
|
|
12
12
|
import "./chunk-5L3FPQIJ.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveSites
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MQUOUVQP.js";
|
|
16
16
|
import {
|
|
17
17
|
queueDraft
|
|
18
18
|
} from "./chunk-62VF32IC.js";
|
|
@@ -30,12 +30,12 @@ import "./chunk-SEEA6RXF.js";
|
|
|
30
30
|
import "./chunk-73UFRZKY.js";
|
|
31
31
|
import {
|
|
32
32
|
runAudits
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-GASBX52O.js";
|
|
35
|
-
import "./chunk-YAMRVXOD.js";
|
|
33
|
+
} from "./chunk-QRDB4NLB.js";
|
|
36
34
|
import "./chunk-LKGVSM2O.js";
|
|
35
|
+
import "./chunk-GASBX52O.js";
|
|
36
|
+
import "./chunk-VRWUL4TR.js";
|
|
37
37
|
import "./chunk-FDIFTIXC.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-4DHQCN5H.js";
|
|
39
39
|
import "./chunk-A3WDWNN5.js";
|
|
40
40
|
import "./chunk-2OP4JKIQ.js";
|
|
41
41
|
import {
|
|
@@ -46,7 +46,7 @@ import "./chunk-U5SZ4FOP.js";
|
|
|
46
46
|
import {
|
|
47
47
|
listWebsites,
|
|
48
48
|
siteSlug
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-CLWNAMUX.js";
|
|
50
50
|
import {
|
|
51
51
|
openBase,
|
|
52
52
|
readAirtableConfig
|
|
@@ -216,4 +216,4 @@ async function runLaunchCommand(site, opts) {
|
|
|
216
216
|
export {
|
|
217
217
|
runLaunchCommand
|
|
218
218
|
};
|
|
219
|
-
//# sourceMappingURL=launch-
|
|
219
|
+
//# sourceMappingURL=launch-AVKH2JVF.js.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
hasRealScores,
|
|
3
3
|
lighthouseScoresFromResult,
|
|
4
4
|
resolveSlugFromCwd
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-OQFOMKBP.js";
|
|
6
|
+
import "./chunk-CLWNAMUX.js";
|
|
7
7
|
export {
|
|
8
8
|
hasRealScores,
|
|
9
9
|
lighthouseScoresFromResult,
|
|
10
10
|
resolveSlugFromCwd
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=lighthouse-airtable-
|
|
12
|
+
//# sourceMappingURL=lighthouse-airtable-CHANWVO6.js.map
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
appendSkipNotice,
|
|
6
6
|
fleetWorkdir,
|
|
7
7
|
prepareFleetSites
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZMIPG6TR.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveSites
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MQUOUVQP.js";
|
|
12
12
|
import {
|
|
13
13
|
onboard
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UYCAF77E.js";
|
|
15
15
|
import "./chunk-ZTPPCHDB.js";
|
|
16
16
|
import "./chunk-OTGB6YQO.js";
|
|
17
17
|
import "./chunk-LKGVSM2O.js";
|
|
18
18
|
import "./chunk-FDIFTIXC.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-4DHQCN5H.js";
|
|
20
20
|
import "./chunk-XXTZBPUY.js";
|
|
21
21
|
import "./chunk-XTK5VIQB.js";
|
|
22
22
|
import "./chunk-U5SZ4FOP.js";
|
|
@@ -70,4 +70,4 @@ async function runOnboardCommand(site, opts) {
|
|
|
70
70
|
export {
|
|
71
71
|
runOnboardCommand
|
|
72
72
|
};
|
|
73
|
-
//# sourceMappingURL=onboard-
|
|
73
|
+
//# sourceMappingURL=onboard-HF4FTJDE.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
parseAddresses,
|
|
5
5
|
sendApprovedReports,
|
|
6
6
|
withGlobalCc
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PBCGXXG6.js";
|
|
8
8
|
import "./chunk-GECESMVS.js";
|
|
9
9
|
import "./chunk-6QRLRT3P.js";
|
|
10
10
|
import "./chunk-MPBXOJ3N.js";
|
|
@@ -14,7 +14,7 @@ import "./chunk-QG6OSL4M.js";
|
|
|
14
14
|
import "./chunk-DC5H7KEQ.js";
|
|
15
15
|
import "./chunk-4SOCPK7A.js";
|
|
16
16
|
import "./chunk-U5SZ4FOP.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-CLWNAMUX.js";
|
|
18
18
|
import "./chunk-HN6I2XWI.js";
|
|
19
19
|
import "./chunk-6VAL7XJT.js";
|
|
20
20
|
export {
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
sendApprovedReports,
|
|
25
25
|
withGlobalCc
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=orchestrate-
|
|
27
|
+
//# sourceMappingURL=orchestrate-5FMNYJEA.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
preflight
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5P2HVNLZ.js";
|
|
4
4
|
import "./chunk-D4FVAIEJ.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-PBCGXXG6.js";
|
|
6
6
|
import "./chunk-GECESMVS.js";
|
|
7
7
|
import "./chunk-6QRLRT3P.js";
|
|
8
8
|
import "./chunk-MPBXOJ3N.js";
|
|
@@ -12,7 +12,7 @@ import "./chunk-QG6OSL4M.js";
|
|
|
12
12
|
import "./chunk-DC5H7KEQ.js";
|
|
13
13
|
import "./chunk-4SOCPK7A.js";
|
|
14
14
|
import "./chunk-U5SZ4FOP.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-CLWNAMUX.js";
|
|
16
16
|
import "./chunk-HN6I2XWI.js";
|
|
17
17
|
import "./chunk-6VAL7XJT.js";
|
|
18
18
|
|
|
@@ -63,4 +63,4 @@ async function runPreflightCommand(site, opts) {
|
|
|
63
63
|
export {
|
|
64
64
|
runPreflightCommand
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=preflight-
|
|
66
|
+
//# sourceMappingURL=preflight-HTWIX3MN.js.map
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import {
|
|
2
|
+
noWorkingTreeFailure,
|
|
3
|
+
readPrismicConfig
|
|
4
|
+
} from "./chunk-VNB5XBQ4.js";
|
|
5
|
+
import {
|
|
6
|
+
runRecipeOverSites
|
|
7
|
+
} from "./chunk-VPJ7N6P7.js";
|
|
8
|
+
import {
|
|
9
|
+
appendSkipNotice,
|
|
10
|
+
fleetWorkdir,
|
|
11
|
+
prepareFleetSites
|
|
12
|
+
} from "./chunk-ZMIPG6TR.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveSites
|
|
15
|
+
} from "./chunk-MQUOUVQP.js";
|
|
16
|
+
import {
|
|
17
|
+
PRETTIER_FLAG_NOTE,
|
|
18
|
+
formatWithPrettier,
|
|
19
|
+
resolveTargetPrettier
|
|
20
|
+
} from "./chunk-R53VL3RI.js";
|
|
21
|
+
import {
|
|
22
|
+
readGitHubConfig
|
|
23
|
+
} from "./chunk-GASBX52O.js";
|
|
24
|
+
import {
|
|
25
|
+
makeGitHub
|
|
26
|
+
} from "./chunk-VRWUL4TR.js";
|
|
27
|
+
import "./chunk-FDIFTIXC.js";
|
|
28
|
+
import {
|
|
29
|
+
defaultSpawn
|
|
30
|
+
} from "./chunk-4DHQCN5H.js";
|
|
31
|
+
import {
|
|
32
|
+
siteLabel
|
|
33
|
+
} from "./chunk-XXTZBPUY.js";
|
|
34
|
+
import {
|
|
35
|
+
branchName,
|
|
36
|
+
checkoutBranch,
|
|
37
|
+
commit,
|
|
38
|
+
createBranch,
|
|
39
|
+
currentBranch,
|
|
40
|
+
deleteBranch,
|
|
41
|
+
isOwnerRepo,
|
|
42
|
+
isWorkingTreeClean,
|
|
43
|
+
push
|
|
44
|
+
} from "./chunk-XTK5VIQB.js";
|
|
45
|
+
import "./chunk-U5SZ4FOP.js";
|
|
46
|
+
|
|
47
|
+
// src/cli/commands/prismic-ci.ts
|
|
48
|
+
import { readdir } from "fs/promises";
|
|
49
|
+
import { resolve } from "path";
|
|
50
|
+
|
|
51
|
+
// src/recipes/prismic-ci/index.ts
|
|
52
|
+
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
53
|
+
import { dirname, join } from "path";
|
|
54
|
+
|
|
55
|
+
// src/recipes/prismic-ci/template.ts
|
|
56
|
+
var WORKFLOW_PATH = ".github/workflows/prismic-models.yml";
|
|
57
|
+
var SECRET = "PRISMIC_WRITE_TOKEN";
|
|
58
|
+
var REUSABLE_WORKFLOW = "reddoorla/.github/.github/workflows/prismic-models.yml";
|
|
59
|
+
var APPLY_BRANCH = "main";
|
|
60
|
+
var REUSABLE_WORKFLOW_PIN = {
|
|
61
|
+
sha: "558395431ddcb481ecba3dd84b78b38c338cfa03",
|
|
62
|
+
tag: "v1.4.0"
|
|
63
|
+
};
|
|
64
|
+
function isPinResolved(pin) {
|
|
65
|
+
return /^[0-9a-f]{40}$/.test(pin.sha);
|
|
66
|
+
}
|
|
67
|
+
function prismicCiWorkflow(pin) {
|
|
68
|
+
return `# Delivers this site's Prismic model changes. Managed by @reddoorla/maintenance
|
|
69
|
+
# (\`reddoor-maint prismic-ci\`) \u2014 change it there and re-run, not here.
|
|
70
|
+
#
|
|
71
|
+
# On a PR touching a model: comment the delta, write nothing.
|
|
72
|
+
# On merge to ${APPLY_BRANCH}: push those models to Prismic. Never delete.
|
|
73
|
+
#
|
|
74
|
+
# THE BRANCH FILTER ON \`push:\` IS LOAD-BEARING, not tidiness. The reusable
|
|
75
|
+
# workflow's apply job also guards \`github.ref == 'refs/heads/${APPLY_BRANCH}'\`,
|
|
76
|
+
# and its comment calls this the other half of that gate: an unfiltered
|
|
77
|
+
# \`on: push:\` fires on every branch AND every tag, so a feature branch's models
|
|
78
|
+
# would reach production with no pull request and therefore no review anywhere in
|
|
79
|
+
# the sequence. Keep both halves.
|
|
80
|
+
name: prismic-models
|
|
81
|
+
|
|
82
|
+
on:
|
|
83
|
+
# No branch filter here, deliberately: a model PR into any base deserves its
|
|
84
|
+
# delta comment, and the dry job is INCAPABLE of writing \u2014 it never passes
|
|
85
|
+
# \`--apply\`, and it holds no job that does.
|
|
86
|
+
pull_request:
|
|
87
|
+
paths:
|
|
88
|
+
- "customtypes/**"
|
|
89
|
+
- "src/lib/slices/**/model.json"
|
|
90
|
+
push:
|
|
91
|
+
branches: [${APPLY_BRANCH}]
|
|
92
|
+
paths:
|
|
93
|
+
- "customtypes/**"
|
|
94
|
+
- "src/lib/slices/**/model.json"
|
|
95
|
+
|
|
96
|
+
jobs:
|
|
97
|
+
prismic-models:
|
|
98
|
+
# A called workflow's jobs can only NARROW what the caller granted, so the
|
|
99
|
+
# PR-comment permission has to be granted here as well as there. Nothing in
|
|
100
|
+
# either job pushes code, so \`contents\` stays read.
|
|
101
|
+
permissions:
|
|
102
|
+
contents: read
|
|
103
|
+
pull-requests: write
|
|
104
|
+
uses: ${REUSABLE_WORKFLOW}@${pin.sha} # ${pin.tag}
|
|
105
|
+
secrets:
|
|
106
|
+
# Spelled exactly as the reusable workflow declares it. A workflow-local
|
|
107
|
+
# alias would not be a rename \u2014 it would be an undeclared secret, and the
|
|
108
|
+
# required one would arrive empty.
|
|
109
|
+
${SECRET}: \${{ secrets.${SECRET} }}
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
var PRISMIC_CI_WORKFLOW = prismicCiWorkflow(REUSABLE_WORKFLOW_PIN);
|
|
113
|
+
|
|
114
|
+
// src/recipes/prismic-ci/index.ts
|
|
115
|
+
var BRANCH_PREFIX = "maint/prismic-ci-";
|
|
116
|
+
var PRETTIER_TIMEOUT_MS = 6e4;
|
|
117
|
+
var resultOf = (site, status, notes, commits = []) => ({
|
|
118
|
+
recipe: "prismic-ci",
|
|
119
|
+
site: siteLabel(site),
|
|
120
|
+
status,
|
|
121
|
+
commits,
|
|
122
|
+
notes
|
|
123
|
+
});
|
|
124
|
+
var messageOf = (err) => err instanceof Error ? err.message : String(err);
|
|
125
|
+
function sameWorkflow(current, canonical) {
|
|
126
|
+
const norm = (s) => s.replace(/\r\n/g, "\n").replace(/\s+$/, "");
|
|
127
|
+
return norm(current) === norm(canonical);
|
|
128
|
+
}
|
|
129
|
+
async function prismicCi(site, deps = {}) {
|
|
130
|
+
const repo = site.gitRepo;
|
|
131
|
+
if (!repo) {
|
|
132
|
+
return resultOf(site, "failed", "no Git repo on this site (set Airtable 'Git repo')");
|
|
133
|
+
}
|
|
134
|
+
if (!isOwnerRepo(repo)) {
|
|
135
|
+
return resultOf(
|
|
136
|
+
site,
|
|
137
|
+
"failed",
|
|
138
|
+
`refusing to act on malformed repo identity: expected "owner/repo", got ${JSON.stringify(repo)}`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
let isPrismic;
|
|
142
|
+
try {
|
|
143
|
+
isPrismic = await readPrismicConfig(site.path) !== null;
|
|
144
|
+
} catch (err) {
|
|
145
|
+
return resultOf(site, "failed", `could not read the Prismic config: ${messageOf(err)}`);
|
|
146
|
+
}
|
|
147
|
+
if (!isPrismic) return resultOf(site, "noop", "not a Prismic site (no repositoryName) \u2014 skipped");
|
|
148
|
+
const pin = deps.pin ?? REUSABLE_WORKFLOW_PIN;
|
|
149
|
+
if (!isPinResolved(pin)) {
|
|
150
|
+
return resultOf(
|
|
151
|
+
site,
|
|
152
|
+
"failed",
|
|
153
|
+
`reusable-workflow pin is unresolved (${pin.sha}) \u2014 publish + tag the workflow in reddoorla/.github and set REUSABLE_WORKFLOW_PIN before rolling out`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
const workflow = pin === REUSABLE_WORKFLOW_PIN ? PRISMIC_CI_WORKFLOW : prismicCiWorkflow(pin);
|
|
157
|
+
const ghConfig = readGitHubConfig();
|
|
158
|
+
if (!deps.github && !ghConfig) return resultOf(site, "failed", "GITHUB_TOKEN not set");
|
|
159
|
+
const gh = deps.github ?? makeGitHub({ token: ghConfig.token });
|
|
160
|
+
const spawn = deps.spawn ?? defaultSpawn;
|
|
161
|
+
let hasSecret;
|
|
162
|
+
try {
|
|
163
|
+
hasSecret = await gh.secretExists(repo, SECRET);
|
|
164
|
+
} catch (err) {
|
|
165
|
+
return resultOf(
|
|
166
|
+
site,
|
|
167
|
+
"failed",
|
|
168
|
+
`could not determine whether ${repo} has the ${SECRET} secret (${messageOf(err)}) \u2014 refusing to install a workflow that may have no token`
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
if (!hasSecret) {
|
|
172
|
+
return resultOf(
|
|
173
|
+
site,
|
|
174
|
+
"failed",
|
|
175
|
+
`${repo} has no ${SECRET} Actions secret \u2014 the workflow reds the repo on its first model PR without it. Mint one, then: gh secret set ${SECRET} --repo ${repo}`
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
let base;
|
|
179
|
+
try {
|
|
180
|
+
base = await gh.defaultBranch(repo);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
return resultOf(
|
|
183
|
+
site,
|
|
184
|
+
"failed",
|
|
185
|
+
`could not read the default branch of ${repo}: ${messageOf(err)}`
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
if (base !== APPLY_BRANCH) {
|
|
189
|
+
return resultOf(
|
|
190
|
+
site,
|
|
191
|
+
"failed",
|
|
192
|
+
`default branch of ${repo} is ${base}, not ${APPLY_BRANCH} \u2014 the reusable workflow's apply job guards refs/heads/${APPLY_BRANCH}, so merged model changes would never reach Prismic`
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
const existing = await gh.fileContentsOnBranch(repo, base, WORKFLOW_PATH);
|
|
196
|
+
if (existing !== null && sameWorkflow(existing, workflow)) {
|
|
197
|
+
return resultOf(site, "noop", `delivery workflow already current on ${base}`);
|
|
198
|
+
}
|
|
199
|
+
const open = (await gh.openPullRequests(repo)).find((pr) => pr.headRef.startsWith(BRANCH_PREFIX));
|
|
200
|
+
if (open) {
|
|
201
|
+
return resultOf(site, "noop", `delivery workflow PR already open: ${open.url}`);
|
|
202
|
+
}
|
|
203
|
+
if (!await isWorkingTreeClean(site.path)) {
|
|
204
|
+
return resultOf(site, "failed", "working tree not clean \u2014 commit or stash first");
|
|
205
|
+
}
|
|
206
|
+
let original = null;
|
|
207
|
+
try {
|
|
208
|
+
original = await currentBranch(site.path);
|
|
209
|
+
} catch {
|
|
210
|
+
}
|
|
211
|
+
const branch = branchName("prismic-ci");
|
|
212
|
+
const commits = [];
|
|
213
|
+
let pushedOrOpened = false;
|
|
214
|
+
try {
|
|
215
|
+
await createBranch(site.path, branch);
|
|
216
|
+
const dest = join(site.path, WORKFLOW_PATH);
|
|
217
|
+
await mkdir(dirname(dest), { recursive: true });
|
|
218
|
+
await writeFile(dest, workflow, "utf-8");
|
|
219
|
+
const notes = [];
|
|
220
|
+
const bin = await (deps.resolvePrettier ?? resolveTargetPrettier)(site.path);
|
|
221
|
+
if (bin === null) {
|
|
222
|
+
notes.push(PRETTIER_FLAG_NOTE);
|
|
223
|
+
} else if (!await formatWithPrettier(spawn, site.path, [WORKFLOW_PATH], {
|
|
224
|
+
bin,
|
|
225
|
+
timeoutMs: PRETTIER_TIMEOUT_MS
|
|
226
|
+
})) {
|
|
227
|
+
notes.push(PRETTIER_FLAG_NOTE);
|
|
228
|
+
} else if (!sameWorkflow(await readFile(dest, "utf-8"), workflow)) {
|
|
229
|
+
notes.push(
|
|
230
|
+
"this site's prettier reformatted the workflow \u2014 re-runs will not match it as current"
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
const sha = await commit(site.path, "ci: deliver Prismic model changes from merged PRs");
|
|
234
|
+
if (!sha) {
|
|
235
|
+
return resultOf(
|
|
236
|
+
site,
|
|
237
|
+
"noop",
|
|
238
|
+
`${WORKFLOW_PATH} already present and identical in the checkout`
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
commits.push(sha);
|
|
242
|
+
pushedOrOpened = true;
|
|
243
|
+
await (deps.pushBranch ?? push)(site.path, branch);
|
|
244
|
+
const pr = await gh.openPullRequest(repo, {
|
|
245
|
+
head: branch,
|
|
246
|
+
base,
|
|
247
|
+
title: "Deliver Prismic model changes from merged PRs",
|
|
248
|
+
body: "Adds the `prismic-models` workflow. On a PR touching `customtypes/**` or `src/lib/slices/**/model.json` it comments the model delta and writes nothing; on merge to main it pushes those models to Prismic. It can create and update models but never delete \u2014 a model present only in Prismic is reported, not touched."
|
|
249
|
+
});
|
|
250
|
+
notes.unshift(`opened PR ${pr.url}`);
|
|
251
|
+
return resultOf(site, "applied", notes.join("; "), commits);
|
|
252
|
+
} catch (err) {
|
|
253
|
+
return resultOf(site, "failed", messageOf(err), commits);
|
|
254
|
+
} finally {
|
|
255
|
+
if (original !== null && original !== branch) {
|
|
256
|
+
try {
|
|
257
|
+
await checkoutBranch(site.path, original);
|
|
258
|
+
if (!pushedOrOpened) await deleteBranch(site.path, branch);
|
|
259
|
+
} catch (err) {
|
|
260
|
+
console.warn(
|
|
261
|
+
`warning: could not restore branch ${original} after prismic-ci: ${messageOf(err)}`
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// src/cli/commands/prismic-ci.ts
|
|
269
|
+
var messageOf2 = (err) => err instanceof Error ? err.message : String(err);
|
|
270
|
+
var failedRow = (site, notes) => ({
|
|
271
|
+
recipe: "prismic-ci",
|
|
272
|
+
site,
|
|
273
|
+
status: "failed",
|
|
274
|
+
commits: [],
|
|
275
|
+
notes
|
|
276
|
+
});
|
|
277
|
+
function formatPrismicCiResults(results) {
|
|
278
|
+
const lines = results.map((r) => `[${r.site}] ${r.status}: ${r.notes ?? ""}`.trimEnd());
|
|
279
|
+
const n = (s) => results.filter((r) => r.status === s).length;
|
|
280
|
+
const failed = n("failed");
|
|
281
|
+
lines.push("");
|
|
282
|
+
if (failed > 0 && n("applied") === 0) {
|
|
283
|
+
lines.push(
|
|
284
|
+
`\u26D4 NO SITE GOT THE DELIVERY WORKFLOW. ${failed} of ${results.length} site(s) failed and not one pull request was opened, so no site's model changes reach Prismic on merge. Do NOT read this run as a rollout.`
|
|
285
|
+
);
|
|
286
|
+
lines.push("");
|
|
287
|
+
}
|
|
288
|
+
lines.push(`${n("applied")} applied, ${n("noop")} noop, ${failed} failed.`);
|
|
289
|
+
return lines.join("\n");
|
|
290
|
+
}
|
|
291
|
+
async function checkoutFailure(repoRoot) {
|
|
292
|
+
let entries;
|
|
293
|
+
try {
|
|
294
|
+
entries = await readdir(repoRoot);
|
|
295
|
+
} catch (e) {
|
|
296
|
+
return `cannot read this checkout at ${repoRoot}: ${messageOf2(e)}`;
|
|
297
|
+
}
|
|
298
|
+
return noWorkingTreeFailure(
|
|
299
|
+
repoRoot,
|
|
300
|
+
entries,
|
|
301
|
+
"No delivery workflow was proposed for it and no pull request was opened"
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
async function runPrismicCiCommand(site, opts, deps = {}) {
|
|
305
|
+
const cwd = opts.cwd ? resolve(opts.cwd) : process.cwd();
|
|
306
|
+
let sites = await resolveSites({
|
|
307
|
+
...site !== void 0 ? { site } : {},
|
|
308
|
+
...opts.fleet !== void 0 ? { fleet: opts.fleet } : {},
|
|
309
|
+
// Passed through because `--fleet airtable` derives each site's path from
|
|
310
|
+
// it; without it the keyword inventory would resolve paths under a different
|
|
311
|
+
// workdir than the one this run then prepares and commits in.
|
|
312
|
+
...opts.workdir !== void 0 ? { workdir: opts.workdir } : {},
|
|
313
|
+
cwd
|
|
314
|
+
});
|
|
315
|
+
if (sites.length === 0) {
|
|
316
|
+
return {
|
|
317
|
+
output: `the inventory resolved NO SITES, so no site was offered the delivery workflow. This is not a delivered fleet \u2014 check the inventory (an Airtable view filter, an empty JSON file, a dynamic inventory returning []). Do NOT read this exit as a rollout.`,
|
|
318
|
+
code: 1
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
let skipped = [];
|
|
322
|
+
if (opts.fleet) {
|
|
323
|
+
const prep = await prepareFleetSites(sites, { workdir: opts.workdir ?? fleetWorkdir() });
|
|
324
|
+
sites = prep.prepared;
|
|
325
|
+
skipped = prep.skipped;
|
|
326
|
+
}
|
|
327
|
+
const pin = deps.pin ?? REUSABLE_WORKFLOW_PIN;
|
|
328
|
+
const pinUnresolved = !isPinResolved(pin) ? `\u26D4 the reusable-workflow pin is unresolved (${pin.sha}) \u2014 every site below would be REFUSED, not delivered. Publish and tag the workflow in reddoorla/.github, then set REUSABLE_WORKFLOW_PIN.` : "";
|
|
329
|
+
if (opts.dry) {
|
|
330
|
+
const lines = sites.map(
|
|
331
|
+
(s) => `[${siteLabel(s)}] would be offered the delivery workflow (no gate was evaluated: the secret, default-branch and already-delivered checks run only on a real run)`
|
|
332
|
+
);
|
|
333
|
+
return {
|
|
334
|
+
output: appendSkipNotice(
|
|
335
|
+
[pinUnresolved, lines.join("\n")].filter((s) => s !== "").join("\n\n"),
|
|
336
|
+
skipped
|
|
337
|
+
),
|
|
338
|
+
code: pinUnresolved === "" ? 0 : 1
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
const run = deps.runRecipe ?? ((s) => prismicCi(s, { pin }));
|
|
342
|
+
const results = await runRecipeOverSites("prismic-ci", sites, async (s) => {
|
|
343
|
+
const failure = await checkoutFailure(s.path);
|
|
344
|
+
return failure ? failedRow(siteLabel(s), failure) : run(s);
|
|
345
|
+
});
|
|
346
|
+
for (const s of skipped) {
|
|
347
|
+
results.push(
|
|
348
|
+
failedRow(
|
|
349
|
+
s.site,
|
|
350
|
+
`could not prepare this checkout: ${s.reason}. No delivery workflow was proposed for it \u2014 this is NOT "this site already has one".`
|
|
351
|
+
)
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
output: appendSkipNotice(formatPrismicCiResults(results), skipped),
|
|
356
|
+
code: results.some((r) => r.status === "failed") ? 1 : 0
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
export {
|
|
360
|
+
formatPrismicCiResults,
|
|
361
|
+
runPrismicCiCommand
|
|
362
|
+
};
|
|
363
|
+
//# sourceMappingURL=prismic-ci-BH225Q4L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/prismic-ci.ts","../src/recipes/prismic-ci/index.ts","../src/recipes/prismic-ci/template.ts"],"sourcesContent":["// The fleet face of the `prismic-ci` recipe: land the Prismic model delivery\n// workflow across the fleet, as ONE PULL REQUEST PER REPOSITORY.\n//\n// The blast radius is fifteen live client repositories, and the failure this\n// file is written against is not a bad PR — the recipe's gates handle that, and\n// nothing here can push to a client's main. It is the QUIET one: a run that\n// touched nothing and exited 0, read as a finished rollout. Three facts only the\n// fleet layer can get wrong produce it, and each has a refusal below:\n//\n// - an inventory that resolved NOBODY prints \"0 applied, 0 noop, 0 failed.\"\n// and exits 0, which is indistinguishable from a fleet with nothing left to\n// do. The Airtable inventory is view-filtered; one filter change empties it\n// with no error anywhere.\n// - a site that could not be PREPARED is isolated into `skipped` by\n// `prepareFleetSites` (correctly — one bad row must not abort the fleet) and\n// then disappears from a summary built out of `prepared` alone. It gets a\n// `failed` ROW, because the count is the only thing a machine reads.\n// - a checkout holding `.git` and nothing else answers \"not a Prismic site\" to\n// every read inside it, so the site noops out of the rollout for good — a\n// fleet workdir reuses any non-empty directory forever. Guarded BEFORE the\n// recipe runs: a tree nobody established is not a tree to branch from.\n//\n// SEQUENTIAL, one site at a time, like every other fleet recipe command — see\n// `runRecipeOverSites`. Each site does git work in its own checkout plus a\n// handful of GitHub calls; there is no Airtable write on this path (so the\n// fleet's ≤4.5 req/s throttle does not apply) and nothing parallelism would buy\n// except a burst of writes against fifteen repositories at once.\nimport { readdir } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { prismicCi } from \"../../recipes/prismic-ci/index.js\";\nimport {\n REUSABLE_WORKFLOW_PIN,\n isPinResolved,\n type ReusableWorkflowPin,\n} from \"../../recipes/prismic-ci/template.js\";\nimport type { RecipeResult, Site } from \"../../types.js\";\nimport { fleetWorkdir } from \"../../util/fleet-workdir.js\";\nimport { siteLabel } from \"../../util/site.js\";\nimport { noWorkingTreeFailure } from \"../../util/working-tree.js\";\nimport { appendSkipNotice, prepareFleetSites, type SkippedSite } from \"../fleet/prepare-sites.js\";\nimport { resolveSites } from \"../fleet/resolve-sites.js\";\nimport { runRecipeOverSites } from \"../fleet/run-recipe-over-sites.js\";\n\nexport type PrismicCiCommandOptions = {\n fleet?: string;\n workdir?: string;\n dry?: boolean;\n cwd?: string;\n};\n\n/** Injected only by tests, so the fleet layer's aggregation — counts, exit code,\n * refusals — is exercised without git, GitHub or a network. Production runs the\n * real recipe. */\nexport type PrismicCiCommandDeps = {\n runRecipe?: (site: Site) => Promise<RecipeResult>;\n /**\n * Which `reddoorla/.github` commit this run would pin. Injected only by tests;\n * production uses the shipped {@link REUSABLE_WORKFLOW_PIN}.\n *\n * It is injectable because the unresolved-pin refusal is a SAFETY behaviour\n * that must be tested in both directions at all times, and a test that reads\n * the shipped constant can only ever exercise whichever direction the constant\n * currently happens to be in. Two tests here did exactly that, and the release\n * that resolved the pin turned them from \"the refusal works\" into a red suite\n * with the refusal itself no longer covered by anything.\n */\n pin?: ReusableWorkflowPin;\n};\n\nconst messageOf = (err: unknown): string => (err instanceof Error ? err.message : String(err));\n\nconst failedRow = (site: string, notes: string): RecipeResult => ({\n recipe: \"prismic-ci\",\n site,\n status: \"failed\",\n commits: [],\n notes,\n});\n\n/**\n * One line per site plus a counts summary — the shape every fleet rollout\n * prints, so a sweep over fifteen repos is scannable.\n *\n * The banner above the counts is not decoration. A rollout in which every site\n * failed prints fifteen `[site] failed:` lines and then an arithmetic exercise;\n * the one fact an operator needs from that run — NOT ONE repository got the\n * workflow — has to be stated. It is keyed on \"sites were attempted and none was\n * applied\", not on \"nothing was applied\": a fleet that is already fully\n * delivered applies nothing every time it runs, and a banner that shouts at that\n * run is a banner nobody reads at the run above.\n */\nexport function formatPrismicCiResults(results: RecipeResult[]): string {\n const lines = results.map((r) => `[${r.site}] ${r.status}: ${r.notes ?? \"\"}`.trimEnd());\n const n = (s: RecipeResult[\"status\"]) => results.filter((r) => r.status === s).length;\n const failed = n(\"failed\");\n lines.push(\"\");\n if (failed > 0 && n(\"applied\") === 0) {\n lines.push(\n `⛔ NO SITE GOT THE DELIVERY WORKFLOW. ${failed} of ${results.length} site(s) failed and` +\n ` not one pull request was opened, so no site's model changes reach Prismic on merge.` +\n ` Do NOT read this run as a rollout.`,\n );\n lines.push(\"\");\n }\n lines.push(`${n(\"applied\")} applied, ${n(\"noop\")} noop, ${failed} failed.`);\n return lines.join(\"\\n\");\n}\n\n/**\n * Is there a checkout here at all, or the named reason there is not?\n *\n * Runs BEFORE the recipe, for both the reason in {@link noWorkingTreeFailure}\n * and one this command adds: the recipe's next steps create a branch, write a\n * file and commit it. A directory nobody managed to check out is not a tree to\n * do that in, and the answer the recipe would otherwise reach — \"not a Prismic\n * site\" — is the one answer that quietly removes the site from the rollout.\n *\n * A `readdir` that THROWS is its own failure and never the skip: a path that\n * does not exist, or one this process cannot read, is not a repo without\n * Prismic in it.\n */\nasync function checkoutFailure(repoRoot: string): Promise<string | null> {\n let entries: string[];\n try {\n entries = await readdir(repoRoot);\n } catch (e) {\n return `cannot read this checkout at ${repoRoot}: ${messageOf(e)}`;\n }\n return noWorkingTreeFailure(\n repoRoot,\n entries,\n \"No delivery workflow was proposed for it and no pull request was opened\",\n );\n}\n\n/**\n * Roll the delivery workflow out to one site or to the fleet.\n *\n * `resolveSites` is allowed to THROW (a positional site alongside `--fleet`, an\n * unsupported inventory extension, an Airtable read that failed). Those are \"the\n * fleet itself could not be established\", which has no per-site row to live in\n * and must not be reported as a rollout across zero sites; `bin.ts` prints the\n * message and exits with the error's own `exitCode`.\n */\nexport async function runPrismicCiCommand(\n site: string | undefined,\n opts: PrismicCiCommandOptions,\n deps: PrismicCiCommandDeps = {},\n): Promise<{ output: string; code: number }> {\n const cwd = opts.cwd ? resolve(opts.cwd) : process.cwd();\n let sites = await resolveSites({\n ...(site !== undefined ? { site } : {}),\n ...(opts.fleet !== undefined ? { fleet: opts.fleet } : {}),\n // Passed through because `--fleet airtable` derives each site's path from\n // it; without it the keyword inventory would resolve paths under a different\n // workdir than the one this run then prepares and commits in.\n ...(opts.workdir !== undefined ? { workdir: opts.workdir } : {}),\n cwd,\n });\n\n // NOTHING RESOLVED IS NOT A DELIVERED FLEET — the refusal `runFleetSweep` and\n // the token doctor both open with, for the same reason: the summary below\n // would print \"0 applied, 0 noop, 0 failed.\" over no rows at all and exit 0,\n // which is exactly what a finished rollout looks like.\n if (sites.length === 0) {\n return {\n output:\n `the inventory resolved NO SITES, so no site was offered the delivery workflow.` +\n ` This is not a delivered fleet — check the inventory (an Airtable view filter, an` +\n ` empty JSON file, a dynamic inventory returning []). Do NOT read this exit as a` +\n ` rollout.`,\n code: 1,\n };\n }\n\n let skipped: SkippedSite[] = [];\n if (opts.fleet) {\n const prep = await prepareFleetSites(sites, { workdir: opts.workdir ?? fleetWorkdir() });\n sites = prep.prepared;\n skipped = prep.skipped;\n }\n\n // THE PIN, checked here as well as in the recipe — not a second copy of the\n // gate but the same exported predicate on the same pin, asked at the one point\n // the recipe cannot answer for: a `--dry` run never reaches the recipe at all,\n // and a preview that promised fifteen pull requests the real run would refuse\n // is a preview of something that cannot happen.\n //\n // ONE pin object serves both this preview and the recipe below, so the preview\n // can never be answering about a different pin than the run it previews.\n const pin = deps.pin ?? REUSABLE_WORKFLOW_PIN;\n const pinUnresolved = !isPinResolved(pin)\n ? `⛔ the reusable-workflow pin is unresolved (${pin.sha}) — every site` +\n ` below would be REFUSED, not delivered. Publish and tag the workflow in` +\n ` reddoorla/.github, then set REUSABLE_WORKFLOW_PIN.`\n : \"\";\n\n if (opts.dry) {\n const lines = sites.map(\n (s) =>\n `[${siteLabel(s)}] would be offered the delivery workflow (no gate was evaluated:` +\n ` the secret, default-branch and already-delivered checks run only on a real run)`,\n );\n return {\n output: appendSkipNotice(\n [pinUnresolved, lines.join(\"\\n\")].filter((s) => s !== \"\").join(\"\\n\\n\"),\n skipped,\n ),\n code: pinUnresolved === \"\" ? 0 : 1,\n };\n }\n\n const run = deps.runRecipe ?? ((s: Site) => prismicCi(s, { pin }));\n const results = await runRecipeOverSites(\"prismic-ci\", sites, async (s) => {\n const failure = await checkoutFailure(s.path);\n return failure ? failedRow(siteLabel(s), failure) : run(s);\n });\n\n // A SITE THAT COULD NOT BE PREPARED IS A SITE THAT DID NOT GET THE WORKFLOW,\n // and it gets a row. `prepareFleetSites` isolates the clone failure into\n // `skipped`, which is right and is also exactly how a site disappears: a\n // summary walking `prepared` alone counts a fleet-wide clone outage — an\n // expired App token, GitHub down, a full disk — as \"0 applied, 0 failed\",\n // exit 0. The notice below stays; the row is what makes the site countable.\n for (const s of skipped) {\n results.push(\n failedRow(\n s.site,\n `could not prepare this checkout: ${s.reason}. No delivery workflow was proposed` +\n ` for it — this is NOT \"this site already has one\".`,\n ),\n );\n }\n\n return {\n output: appendSkipNotice(formatPrismicCiResults(results), skipped),\n code: results.some((r) => r.status === \"failed\") ? 1 : 0,\n };\n}\n","import { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\nimport { defaultSpawn, type SpawnFn } from \"../../audits/util/spawn.js\";\nimport { readGitHubConfig } from \"../../github/config.js\";\nimport { makeGitHub, type GitHub } from \"../../github/gh.js\";\nimport { readPrismicConfig } from \"../../prismic/models/index.js\";\nimport type { RecipeResult, Site } from \"../../types.js\";\nimport {\n branchName,\n checkoutBranch,\n commit as gitCommit,\n createBranch,\n currentBranch,\n deleteBranch,\n isOwnerRepo,\n isWorkingTreeClean,\n push as gitPush,\n} from \"../../util/git.js\";\nimport { siteLabel } from \"../../util/site.js\";\nimport { formatWithPrettier, resolveTargetPrettier, PRETTIER_FLAG_NOTE } from \"../_prettier.js\";\nimport {\n APPLY_BRANCH,\n PRISMIC_CI_WORKFLOW,\n REUSABLE_WORKFLOW_PIN,\n SECRET,\n WORKFLOW_PATH,\n isPinResolved,\n prismicCiWorkflow,\n type ReusableWorkflowPin,\n} from \"./template.js\";\n\n/** Head-branch prefix of every PR this recipe opens. `branchName(\"prismic-ci\")`\n * produces `maint/prismic-ci-<timestamp>`, and the re-run guard matches on this\n * prefix — the same idiom as `findOpenSelfUpdatingPR`. */\nconst BRANCH_PREFIX = \"maint/prismic-ci-\";\n\n/** How long the target's prettier gets. Also what makes the fleet's default\n * spawn detach the child, so the kill reaches prettier and not just a wrapper.\n * Matches the pull-down path's budget in `src/prismic/models/write.ts`. */\nconst PRETTIER_TIMEOUT_MS = 60_000;\n\n/** Just the GitHub surface this recipe touches, so a test fake is five methods\n * rather than thirty. `makeGitHub()` satisfies it structurally. */\nexport type PrismicCiGitHub = Pick<\n GitHub,\n \"defaultBranch\" | \"secretExists\" | \"fileContentsOnBranch\" | \"openPullRequest\" | \"openPullRequests\"\n>;\n\nexport type PrismicCiDeps = {\n github?: PrismicCiGitHub;\n pushBranch?: (cwd: string, branch: string) => Promise<void>;\n spawn?: SpawnFn;\n /** Resolve the TARGET repo's own prettier. Injected so a test can assert the\n * absolute-path spawn without a populated `node_modules`. */\n resolvePrettier?: (repoRoot: string) => Promise<string | null>;\n /** Which `reddoorla/.github` commit the written workflow pins. Injected only\n * by tests; production uses the shipped pin. */\n pin?: ReusableWorkflowPin;\n};\n\nconst resultOf = (\n site: Site,\n status: RecipeResult[\"status\"],\n notes: string,\n commits: string[] = [],\n): RecipeResult => ({\n recipe: \"prismic-ci\",\n site: siteLabel(site),\n status,\n commits,\n notes,\n});\n\nconst messageOf = (err: unknown): string => (err instanceof Error ? err.message : String(err));\n\n/** Same normalization as `self-updating`'s config comparison: CRLF and a stray\n * trailing newline are not drift, and treating them as drift opens a needless\n * PR on every run. Any real content difference still differs. */\nfunction sameWorkflow(current: string, canonical: string): boolean {\n const norm = (s: string) => s.replace(/\\r\\n/g, \"\\n\").replace(/\\s+$/, \"\");\n return norm(current) === norm(canonical);\n}\n\n/**\n * Land the Prismic model delivery workflow in one repo, as a pull request.\n *\n * Everything before the first mutation is a gate, and the gates exist because\n * this recipe's output is the only path in the project that writes to a live\n * client's Prismic repository. Two of them are worth naming:\n *\n * - THE SECRET. A workflow whose `PRISMIC_WRITE_TOKEN` does not exist yet goes\n * red on the repo's first model PR. Landing 15 of those turns a rollout into\n * 15 red repos, so a definitively-absent secret FAILS the site rather than\n * nooping it: \"this site was skipped and a human must act\" is not the same\n * report as \"this site was already done\", and a rollout summary where those\n * two look alike is how a site silently never gets model delivery. A secret\n * whose existence could not be DETERMINED fails too, with different wording —\n * they are different facts and the operator's next move differs.\n *\n * - THE DEFAULT BRANCH. The reusable workflow's apply job hard-codes\n * `refs/heads/main`. On a repo whose default branch is anything else, every\n * model PR would merge green and never reach Prismic. Refuse instead.\n *\n * Nothing here can delete a model: the workflow it installs calls a module that\n * exports no delete path.\n */\nexport async function prismicCi(site: Site, deps: PrismicCiDeps = {}): Promise<RecipeResult> {\n // 1. Repo identity. `failed`, not `noop`: a rollout that silently skips a site\n // is the failure this whole recipe is guarding against one level up. The\n // strict shape check runs BEFORE the first `gh` call, so a typo'd or\n // attacker-controlled value can never be interpolated into an API path.\n const repo = site.gitRepo;\n if (!repo) {\n return resultOf(site, \"failed\", \"no Git repo on this site (set Airtable 'Git repo')\");\n }\n if (!isOwnerRepo(repo)) {\n return resultOf(\n site,\n \"failed\",\n `refusing to act on malformed repo identity: expected \"owner/repo\", got ${JSON.stringify(repo)}`,\n );\n }\n\n // 2. Is this a Prismic site? `readPrismicConfig` returns null for \"no Prismic\n // here\" and THROWS for a present-but-unreadable config — the distinction is\n // the point, so the throw becomes `failed` rather than being caught into\n // the skip branch.\n let isPrismic: boolean;\n try {\n isPrismic = (await readPrismicConfig(site.path)) !== null;\n } catch (err) {\n return resultOf(site, \"failed\", `could not read the Prismic config: ${messageOf(err)}`);\n }\n if (!isPrismic) return resultOf(site, \"noop\", \"not a Prismic site (no repositoryName) — skipped\");\n\n // 3. The pin. Checked before any network call: while it is unresolved NOTHING\n // can roll out, and 15 pointless API round-trips are not worth spending to\n // find that out per site.\n const pin = deps.pin ?? REUSABLE_WORKFLOW_PIN;\n if (!isPinResolved(pin)) {\n return resultOf(\n site,\n \"failed\",\n `reusable-workflow pin is unresolved (${pin.sha}) — publish + tag the workflow in ` +\n `reddoorla/.github and set REUSABLE_WORKFLOW_PIN before rolling out`,\n );\n }\n const workflow = pin === REUSABLE_WORKFLOW_PIN ? PRISMIC_CI_WORKFLOW : prismicCiWorkflow(pin);\n\n const ghConfig = readGitHubConfig();\n if (!deps.github && !ghConfig) return resultOf(site, \"failed\", \"GITHUB_TOKEN not set\");\n const gh = deps.github ?? makeGitHub({ token: ghConfig!.token });\n const spawn = deps.spawn ?? defaultSpawn;\n\n // 4. The secret. Absent and unreadable are separate answers with separate\n // wording; neither proceeds.\n let hasSecret: boolean;\n try {\n hasSecret = await gh.secretExists(repo, SECRET);\n } catch (err) {\n return resultOf(\n site,\n \"failed\",\n `could not determine whether ${repo} has the ${SECRET} secret (${messageOf(err)}) — ` +\n `refusing to install a workflow that may have no token`,\n );\n }\n if (!hasSecret) {\n return resultOf(\n site,\n \"failed\",\n `${repo} has no ${SECRET} Actions secret — the workflow reds the repo on its first ` +\n `model PR without it. Mint one, then: gh secret set ${SECRET} --repo ${repo}`,\n );\n }\n\n // 5. The default branch. NOT `.catch(() => \"main\")`: \"I could not read the\n // default branch\" and \"the default branch is main\" are opposite facts, and\n // guessing the second targets a PR (and an apply gate) at a branch nobody\n // confirmed.\n let base: string;\n try {\n base = await gh.defaultBranch(repo);\n } catch (err) {\n return resultOf(\n site,\n \"failed\",\n `could not read the default branch of ${repo}: ${messageOf(err)}`,\n );\n }\n if (base !== APPLY_BRANCH) {\n return resultOf(\n site,\n \"failed\",\n `default branch of ${repo} is ${base}, not ${APPLY_BRANCH} — the reusable workflow's ` +\n `apply job guards refs/heads/${APPLY_BRANCH}, so merged model changes would never reach Prismic`,\n );\n }\n\n // 6. Already delivered? Content-compared, not existence-compared, so a\n // present-but-STALE workflow (an older pin) is corrected rather than left\n // forever.\n const existing = await gh.fileContentsOnBranch(repo, base, WORKFLOW_PATH);\n if (existing !== null && sameWorkflow(existing, workflow)) {\n return resultOf(site, \"noop\", `delivery workflow already current on ${base}`);\n }\n\n // 7. Already proposed? Without this, every run before the PR merges opens\n // another one. `fileContentsOnBranch` also answers null for a read it could\n // not perform (gh exits non-zero on both a 404 and an auth failure), which\n // makes this the backstop for that collapse as well.\n const open = (await gh.openPullRequests(repo)).find((pr) => pr.headRef.startsWith(BRANCH_PREFIX));\n if (open) {\n return resultOf(site, \"noop\", `delivery workflow PR already open: ${open.url}`);\n }\n\n if (!(await isWorkingTreeClean(site.path))) {\n return resultOf(site, \"failed\", \"working tree not clean — commit or stash first\");\n }\n\n // Capture the operator's branch BEFORE creating ours so the `finally` can put\n // them back. Best-effort: if we cannot read it we skip the restore rather than\n // guess at a branch to check out.\n let original: string | null = null;\n try {\n original = await currentBranch(site.path);\n } catch {\n // Stays null (detached HEAD, git error) — the restore below is then skipped\n // rather than aiming a checkout at a branch name we had to invent.\n }\n const branch = branchName(\"prismic-ci\");\n const commits: string[] = [];\n let pushedOrOpened = false;\n\n try {\n await createBranch(site.path, branch);\n const dest = join(site.path, WORKFLOW_PATH);\n await mkdir(dirname(dest), { recursive: true });\n await writeFile(dest, workflow, \"utf-8\");\n\n // Format with the SITE's own prettier, resolved POSITIVELY and run by\n // absolute path. `pnpm exec prettier` here would run a full `pnpm install`\n // in the client's repo first (an unrequested mutation of a live client repo\n // by a rollout that is supposed to add one file), and in a repo without\n // prettier would then format with the CALLING repo's binary and exit 0.\n const notes: string[] = [];\n const bin = await (deps.resolvePrettier ?? resolveTargetPrettier)(site.path);\n if (bin === null) {\n notes.push(PRETTIER_FLAG_NOTE);\n } else if (\n !(await formatWithPrettier(spawn, site.path, [WORKFLOW_PATH], {\n bin,\n timeoutMs: PRETTIER_TIMEOUT_MS,\n }))\n ) {\n notes.push(PRETTIER_FLAG_NOTE);\n } else if (!sameWorkflow(await readFile(dest, \"utf-8\"), workflow)) {\n // The site's prettier config disagrees with the template's shape (single\n // quotes, a different tab width). Harmless for the workflow — but the\n // step-6 comparison is byte-based, so this site will not recognise its own\n // delivered workflow as current and will propose it again after each\n // merge. Say so rather than let it be discovered as a mystery PR.\n notes.push(\n \"this site's prettier reformatted the workflow — re-runs will not match it as current\",\n );\n }\n\n const sha = await gitCommit(site.path, \"ci: deliver Prismic model changes from merged PRs\");\n if (!sha) {\n // Git saw no change: the checkout already holds this exact workflow even\n // though the default branch does not. Nothing to push and nothing to\n // review — and pushing a commit-less branch would fail at PR creation.\n return resultOf(\n site,\n \"noop\",\n `${WORKFLOW_PATH} already present and identical in the checkout`,\n );\n }\n commits.push(sha);\n pushedOrOpened = true;\n await (deps.pushBranch ?? gitPush)(site.path, branch);\n const pr = await gh.openPullRequest(repo, {\n head: branch,\n base,\n title: \"Deliver Prismic model changes from merged PRs\",\n body:\n \"Adds the `prismic-models` workflow. On a PR touching `customtypes/**` or \" +\n \"`src/lib/slices/**/model.json` it comments the model delta and writes nothing; \" +\n \"on merge to main it pushes those models to Prismic. It can create and update \" +\n \"models but never delete — a model present only in Prismic is reported, not touched.\",\n });\n notes.unshift(`opened PR ${pr.url}`);\n return resultOf(site, \"applied\", notes.join(\"; \"), commits);\n } catch (err) {\n return resultOf(site, \"failed\", messageOf(err), commits);\n } finally {\n // Restore the operator's branch on success AND on failure — otherwise a push\n // error strands the checkout on the recipe branch with an unpushed commit,\n // and the retry dies at createBranch. Best-effort; never masks the result.\n if (original !== null && original !== branch) {\n try {\n await checkoutBranch(site.path, original);\n // Nothing was pushed and no PR exists, so the local branch is litter and\n // a re-run would leave another. Only ever the branch WE created.\n if (!pushedOrOpened) await deleteBranch(site.path, branch);\n } catch (err) {\n console.warn(\n `warning: could not restore branch ${original} after prismic-ci: ${messageOf(err)}`,\n );\n }\n }\n }\n}\n","/**\n * The caller workflow every Prismic site gets.\n *\n * Fully generic — no per-site values — because the token is the site's own\n * `PRISMIC_WRITE_TOKEN` secret, the name every site's code already reads.\n * Contrast `ci.yml`, which is deliberately NOT templated anywhere in this\n * package because it carries per-site `netlify-site:` / `node-version:` values\n * a byte template would strip fleet-wide.\n */\n\n/** Where the file lands in a site repo. Also the `gh api .../contents/<path>`\n * segment, so it must stay traversal-free (`assertUrlSegment` re-checks). */\nexport const WORKFLOW_PATH = \".github/workflows/prismic-models.yml\";\n\n/** The Actions secret the reusable workflow declares as `required: true`, and\n * the environment variable the CLI reads. Spelled ONCE, here, because the\n * failure mode of a second spelling is silent: a caller passing a name the\n * callee never declared supplies nothing, and the callee's required secret\n * arrives empty at the one step that writes to a live client's Prismic repo. */\nexport const SECRET = \"PRISMIC_WRITE_TOKEN\";\n\n/** The reusable workflow, without a ref. */\nexport const REUSABLE_WORKFLOW = \"reddoorla/.github/.github/workflows/prismic-models.yml\";\n\n/**\n * The ONE branch this delivery path can run its apply job on.\n *\n * Not a preference — the reusable workflow's apply job hard-codes\n * `github.ref == 'refs/heads/main'`. On a repo whose default branch is anything\n * else, a merged model PR would produce a green check and never reach Prismic,\n * which is why the recipe refuses such a repo instead of installing a workflow\n * that silently cannot fire.\n */\nexport const APPLY_BRANCH = \"main\";\n\n/** A commit in `reddoorla/.github`, plus the release tag that commit carries.\n * Both are written into the workflow: the SHA is what Actions resolves, the tag\n * is what a human (and Renovate's github-actions manager) reads. */\nexport type ReusableWorkflowPin = { sha: string; tag: string };\n\n/**\n * What the shipped pin says while the reusable workflow has not been published\n * to `reddoorla/.github` and tagged yet (plan Task 25).\n *\n * DELIBERATELY NOT 40 HEX CHARACTERS. A placeholder shaped like a real SHA is\n * indistinguishable from a real one in review, and would install a workflow\n * referencing a commit that does not exist into 15 client repositories — where\n * it fails at workflow-load time, on every model PR, with an error that names\n * neither this file nor the reason. Unresolved must be unmistakable, and\n * {@link isPinResolved} is what the recipe gates on.\n */\nexport const UNRESOLVED_PIN_SHA = \"UNRESOLVED-publish-and-tag-reddoorla-dot-github-first\";\n\n/**\n * The pin the fleet rolls out.\n *\n * RESOLVED 2026-08-14. `reddoorla/.github#30` merged as\n * 558395431ddcb481ecba3dd84b78b38c338cfa03 and that commit was tagged v1.4.0;\n * `gh api repos/reddoorla/.github/commits/v1.4.0 --jq .sha` returns the SHA\n * below. `validate` (the digest-pinning + Renovate-preset check that is the\n * only CI in that repo) passed on the merge commit.\n *\n * TO RE-RESOLVE after a future `reddoorla/.github` release: set `sha` to\n * `gh api repos/reddoorla/.github/commits/<tag> --jq .sha` and `tag` to that\n * tag. Nothing else changes. Renovate's github-actions manager bumps the\n * already-installed `uses:` line per site repo; this constant is what NEW\n * rollouts install, so a stale value here is not a broken fleet, only a fleet\n * whose newest members start one version behind.\n */\nexport const REUSABLE_WORKFLOW_PIN: ReusableWorkflowPin = {\n sha: \"558395431ddcb481ecba3dd84b78b38c338cfa03\",\n tag: \"v1.4.0\",\n};\n\n/**\n * Is this pin a real commit reference?\n *\n * A full 40-hex SHA and nothing else. Not a tag, not a branch: this repo pins\n * every `uses:` to a commit (see `src/recipes/sync-configs/templates.ts`, whose\n * renovate template spells out why — a retagged `@v3` runs attacker code with\n * whatever token the workflow holds), and Renovate's github-actions manager\n * bumps the pin per repo when `reddoorla/.github` tags a new version.\n */\nexport function isPinResolved(pin: ReusableWorkflowPin): boolean {\n return /^[0-9a-f]{40}$/.test(pin.sha);\n}\n\n/**\n * Render the caller workflow for a pin.\n *\n * Path-filtered on both triggers: this must not run on every commit, only when\n * a model changes.\n */\nexport function prismicCiWorkflow(pin: ReusableWorkflowPin): string {\n return `# Delivers this site's Prismic model changes. Managed by @reddoorla/maintenance\n# (\\`reddoor-maint prismic-ci\\`) — change it there and re-run, not here.\n#\n# On a PR touching a model: comment the delta, write nothing.\n# On merge to ${APPLY_BRANCH}: push those models to Prismic. Never delete.\n#\n# THE BRANCH FILTER ON \\`push:\\` IS LOAD-BEARING, not tidiness. The reusable\n# workflow's apply job also guards \\`github.ref == 'refs/heads/${APPLY_BRANCH}'\\`,\n# and its comment calls this the other half of that gate: an unfiltered\n# \\`on: push:\\` fires on every branch AND every tag, so a feature branch's models\n# would reach production with no pull request and therefore no review anywhere in\n# the sequence. Keep both halves.\nname: prismic-models\n\non:\n # No branch filter here, deliberately: a model PR into any base deserves its\n # delta comment, and the dry job is INCAPABLE of writing — it never passes\n # \\`--apply\\`, and it holds no job that does.\n pull_request:\n paths:\n - \"customtypes/**\"\n - \"src/lib/slices/**/model.json\"\n push:\n branches: [${APPLY_BRANCH}]\n paths:\n - \"customtypes/**\"\n - \"src/lib/slices/**/model.json\"\n\njobs:\n prismic-models:\n # A called workflow's jobs can only NARROW what the caller granted, so the\n # PR-comment permission has to be granted here as well as there. Nothing in\n # either job pushes code, so \\`contents\\` stays read.\n permissions:\n contents: read\n pull-requests: write\n uses: ${REUSABLE_WORKFLOW}@${pin.sha} # ${pin.tag}\n secrets:\n # Spelled exactly as the reusable workflow declares it. A workflow-local\n # alias would not be a rename — it would be an undeclared secret, and the\n # required one would arrive empty.\n ${SECRET}: \\${{ secrets.${SECRET} }}\n`;\n}\n\n/** The workflow as currently shipped. Unusable — and refused by the recipe —\n * until {@link REUSABLE_WORKFLOW_PIN} is resolved. */\nexport const PRISMIC_CI_WORKFLOW = prismicCiWorkflow(REUSABLE_WORKFLOW_PIN);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,eAAe;AACxB,SAAS,eAAe;;;AC5BxB,SAAS,OAAO,UAAU,iBAAiB;AAC3C,SAAS,SAAS,YAAY;;;ACWvB,IAAM,gBAAgB;AAOtB,IAAM,SAAS;AAGf,IAAM,oBAAoB;AAW1B,IAAM,eAAe;AAoCrB,IAAM,wBAA6C;AAAA,EACxD,KAAK;AAAA,EACL,KAAK;AACP;AAWO,SAAS,cAAc,KAAmC;AAC/D,SAAO,iBAAiB,KAAK,IAAI,GAAG;AACtC;AAQO,SAAS,kBAAkB,KAAkC;AAClE,SAAO;AAAA;AAAA;AAAA;AAAA,gBAIO,YAAY;AAAA;AAAA;AAAA,iEAGqC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAgB5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