Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
42dd9a1
fix : Update get Deployment logs query to GetDeploymentLogsV2 to matc…
AryanBansal-launch Aug 5, 2026
c421930
fix(deps): resolve 8 npm advisories via npm overrides
dhruv-parekh-cs Aug 24, 2026
5c3fd6c
CL-4965 | Consolidate secrets-scan onto the shared Talisman + truffle…
venkatesh-cstk Aug 26, 2026
bcf443a
Merge pull request #224 from contentstack/cl-4965
venkatesh-cstk Aug 26, 2026
87d7de8
fix(deps): resolve 8 Snyk vulnerabilities via scoped overrides
dhruv-parekh-cs Aug 27, 2026
41d6f56
fix(deps): bump adm-zip to 0.6.0 and override qs to 6.16.0
dhruv-parekh-cs Aug 31, 2026
9321dab
fix(deps): allowlist file-upload.ts in talisman (+Claude)
dhruv-parekh-cs Aug 31, 2026
09cd079
test(file-upload): cover the archive() zip-failure path (+Claude)
dhruv-parekh-cs Aug 31, 2026
5a27251
test(file-upload): scope the scanner exception to the auth-flag test …
dhruv-parekh-cs Aug 31, 2026
5957580
test(file-upload): extend scanner exceptions to remaining pre-existin…
dhruv-parekh-cs Aug 31, 2026
edf6986
test(file-upload): match the map callback fragment talisman reports (…
dhruv-parekh-cs Aug 31, 2026
3bb3ff2
refactor(file-upload): use try/catch for the zip failure path (+Claude)
dhruv-parekh-cs Aug 31, 2026
8496f57
fix(deps): resolve high-severity browserslist DoS/prototype-write adv…
dhruv-parekh-cs Sep 2, 2026
916fe9e
fix(deps): raise fast-uri override to ^3.1.7
dhruv-parekh-cs Sep 3, 2026
85242d0
fix(deps): repair broken lockfile resolution and bump nyc/shx to clea…
dhruv-parekh-cs Sep 10, 2026
6755575
fix(deps): resolve critical proxy-addr, high adm-zip, and fast-uri Sn…
dhruv-parekh-cs Sep 21, 2026
d191fde
feat(launch): rebuild the CLI on REST as the v2 skeleton
naeem-shakh-cs Sep 23, 2026
06639c0
fix(cloud-function): load data url modules from the commonjs build
naeem-shakh-cs Sep 23, 2026
e9904dd
fix(config): fall back to the region cma when it declares no launch h…
naeem-shakh-cs Sep 23, 2026
18c47eb
fix(config): use multi-branch project config files instead of ignorin…
naeem-shakh-cs Sep 23, 2026
19f9fbf
fix(release): publish prerelease versions to the beta dist-tag
naeem-shakh-cs Sep 23, 2026
04dcf3f
fix(flags): treat a null config value as an unsupplied input
naeem-shakh-cs Sep 23, 2026
48eb623
fix(output): never print a pagination range whose end precedes its start
naeem-shakh-cs Sep 23, 2026
978ddbb
fix(commands): fall back for every rendered field so a sparse row can…
naeem-shakh-cs Sep 23, 2026
8e1508a
fix(api): fail loudly when a 200 body is missing its envelope
naeem-shakh-cs Sep 23, 2026
52a22b5
fix(config): reject a primitive block and an array root as project co…
naeem-shakh-cs Sep 23, 2026
01af8ac
test(http): assert the retry, refresh and status-boundary behaviour
naeem-shakh-cs Sep 23, 2026
92685a2
test(base): pin the auth gate, terminal detection and session wiring
naeem-shakh-cs Sep 23, 2026
bc82289
test(flags): assert the real resolution specs and the not-supplied se…
naeem-shakh-cs Sep 23, 2026
0fc11f0
test(commands): cover the selector edge cases and the rendered comman…
naeem-shakh-cs Sep 23, 2026
c599226
refactor(cloud-function): extract the listener start into a seam
naeem-shakh-cs Sep 23, 2026
d24bd89
chore(jest): run the suite with vm modules enabled
naeem-shakh-cs Sep 23, 2026
a77f42e
test(functions): cover the serve command and the cloud function runtime
naeem-shakh-cs Sep 23, 2026
f32886d
chore(jest): delete the cloud-function coverage exclusions
naeem-shakh-cs Sep 23, 2026
f94b1bc
docs(agents): record what the tests must prove and the jest esm const…
naeem-shakh-cs Sep 23, 2026
ba9b835
fix(http): stop the utility interceptor re-sending a request our poli…
naeem-shakh-cs Sep 23, 2026
b3caf69
fix(select): resolve a project name anywhere in the organization, not…
naeem-shakh-cs Sep 23, 2026
368dbb3
fix(flags): resolve inputs in dependency order instead of object key …
naeem-shakh-cs Sep 23, 2026
f313d6a
docs(agents): drop the stale claim that jest excludes cloud-function …
naeem-shakh-cs Sep 23, 2026
6525f5c
refactor(flags): carry each flag's value type through resolution
naeem-shakh-cs Sep 23, 2026
83ca472
refactor(layout): move to core, transport and per-resource folders
naeem-shakh-cs Sep 23, 2026
dfed524
refactor(resources): give each resource its own flags, wording and pr…
naeem-shakh-cs Sep 23, 2026
44c4bc5
refactor(transport): choose one auth strategy instead of reading conf…
naeem-shakh-cs Sep 23, 2026
5f99762
refactor(core): give every Launch error its own exit code, and bring …
naeem-shakh-cs Sep 23, 2026
78dfc15
refactor(projects): make a project reference a type, not a string
naeem-shakh-cs Sep 23, 2026
6f9640c
feat(core): model .cs-launch.json as a store over a typed config
naeem-shakh-cs Sep 23, 2026
b0e4f04
test(integration): cover the four end-to-end flows nothing exercised
naeem-shakh-cs Sep 23, 2026
4f791c4
fix(core): rewrite only a trailing io in a derived launch hub host
naeem-shakh-cs Sep 23, 2026
cd9af14
docs(agents): rewrite the recipe for resources, not for commands
naeem-shakh-cs Sep 23, 2026
2f2c0c5
refactor(functions): declare the serve flags without casting them back
naeem-shakh-cs Sep 23, 2026
1777662
fix(core): treat a blank string as an absent input
naeem-shakh-cs Sep 23, 2026
dbc85e7
fix(transport): restore what disarming the utility interceptor removed
naeem-shakh-cs Sep 23, 2026
269a975
refactor(core): keep the pagination shape in core rather than in a re…
naeem-shakh-cs Sep 23, 2026
cb80d86
fix(core): make the table and pagination renderers total
naeem-shakh-cs Sep 23, 2026
2a38580
test(integration): set isTTY through a property descriptor so the pic…
naeem-shakh-cs Sep 23, 2026
72a2b3f
fix(core): refuse to prompt or normalise past an absent dependency
naeem-shakh-cs Sep 23, 2026
f172e3f
fix(projects): take a config-supplied uid as a uid instead of re-snif…
naeem-shakh-cs Sep 23, 2026
af781e3
fix(functions): bring serve inside the exit-code and precedence contract
naeem-shakh-cs Sep 23, 2026
cce71b0
fix(core): close the minor findings the review raised
naeem-shakh-cs Sep 23, 2026
4a4c255
refactor(core): delete the three dead modules the review found
naeem-shakh-cs Sep 23, 2026
21fe6f3
docs(agents): record what these fixes changed about the contract
naeem-shakh-cs Sep 23, 2026
66a5797
refactor(core): settle the pagination constants against the real API
naeem-shakh-cs Sep 23, 2026
4b20675
feat(cli): retire the V1 command names with their own migration message
naeem-shakh-cs Sep 23, 2026
9901eb2
feat(projects): add projects:delete behind the confirm gate
naeem-shakh-cs Sep 23, 2026
341aad8
feat(projects): add projects:update for the two updatable fields
naeem-shakh-cs Sep 23, 2026
7ec41d8
chore(git): ignore .npmrc so a registry token cannot be committed
naeem-shakh-cs Sep 23, 2026
3d4fd59
feat(deployments): add the deployment wait/stream loop
naeem-shakh-cs Sep 23, 2026
83301c6
feat(core): add the input value helpers and the --type flag
naeem-shakh-cs Sep 23, 2026
62a6f73
feat(deployments): add the deployments, environments and git resources
naeem-shakh-cs Sep 23, 2026
31a26d1
feat(projects): add projects:create for the GitHub and FileUpload paths
naeem-shakh-cs Sep 23, 2026
c5e9b86
docs(agents): record the wait loop, projects:create and the doc-vs-DT…
naeem-shakh-cs Sep 23, 2026
eb974e6
chore(release): move the v2 line from alpha.0 to beta.0
naeem-shakh-cs Sep 23, 2026
0fea68b
fix(upload): fold signed-url header names to one canonical casing
naeem-shakh-cs Sep 23, 2026
f95ce41
feat(projects): record a created project in .cs-launch.json
naeem-shakh-cs Sep 23, 2026
0788eb1
fix(functions): make filepath validation reject in linear time
naeem-shakh-cs Sep 24, 2026
ce99b8f
test(functions): mock the cloud functions module with a factory
naeem-shakh-cs Sep 24, 2026
be42607
fix(projects): keep create honest about a detected framework and a fa…
naeem-shakh-cs Sep 24, 2026
5fce564
fix(functions): report an unreadable upload file and a busy port prop…
naeem-shakh-cs Sep 24, 2026
4777ac2
chore(deps): drop four unused dependencies and fix the oclif declarat…
naeem-shakh-cs Sep 24, 2026
1a4c4d6
refactor(transport): extract the response envelope out of the four re…
naeem-shakh-cs Sep 24, 2026
7160d1a
refactor(core): enforce the resource boundary and make two branches r…
naeem-shakh-cs Sep 24, 2026
e88f480
chore(quality): tighten the compiler and lint what was never linted
naeem-shakh-cs Sep 24, 2026
dc69e11
fix(deps): declare tslib as a runtime dependency and pin the lint too…
naeem-shakh-cs Sep 24, 2026
3af7681
fix(projects): refuse an unmatched repository at the picker instead o…
naeem-shakh-cs Sep 24, 2026
75ea2b2
fix(projects): treat an empty answer at an optional create prompt as …
naeem-shakh-cs Sep 24, 2026
ace6f5e
fix(core): refuse to overwrite a .cs-launch.json that cannot be parsed
naeem-shakh-cs Sep 24, 2026
95ef9d9
fix(core): judge cross-flag rules on what the user supplied, not on d…
naeem-shakh-cs Sep 24, 2026
42404e2
feat(organizations): prompt for the organization, as V1 did
naeem-shakh-cs Sep 24, 2026
cb429a7
fix(projects): ask the project type before the organization on create
naeem-shakh-cs Sep 24, 2026
79e2b92
fix(projects): name the project in the delete question, and state the…
naeem-shakh-cs Sep 24, 2026
30062f0
test(deployments): make the watcher's failing-poll fake record its ba…
naeem-shakh-cs Sep 24, 2026
2aac6d6
fix(projects): report the surviving project when a lookup after creat…
naeem-shakh-cs Sep 24, 2026
e3dfeef
test(projects): drive the whole interactive create on the wire, scope…
naeem-shakh-cs Sep 24, 2026
ace1bbd
test: delete cases that could not fail and the dead regex one of them…
naeem-shakh-cs Sep 24, 2026
608dbb5
fix(projects): send the zip content type when the signed url supplies…
naeem-shakh-cs Sep 24, 2026
de79a46
fix(transport): let the envelope helpers own both articles in a malfo…
naeem-shakh-cs Sep 24, 2026
84fb2f4
test: replace filler assertions with ones the code under test can fail
naeem-shakh-cs Sep 24, 2026
3742027
refactor: type API responses as what can arrive, and refuse an entity…
naeem-shakh-cs Sep 24, 2026
862e1e1
test(projects): keep the create command test inside its own resource
naeem-shakh-cs Sep 24, 2026
35481c9
refactor: let a normalized literal union reach this.resolved and Crea…
naeem-shakh-cs Sep 24, 2026
9504d2e
refactor: remove the remaining production casts, and read .cs-launch.…
naeem-shakh-cs Sep 24, 2026
63f095f
fix(transport): read an untrusted API error body entry by entry
naeem-shakh-cs Sep 24, 2026
bb257d4
fix(core): derive the hub url from a cma host that begins with http w…
naeem-shakh-cs Sep 24, 2026
37c5e74
refactor: drop the last redundant cast and the two eslint-disable com…
naeem-shakh-cs Sep 24, 2026
d6a2898
refactor(core): rename globalFlags to coreFlags
naeem-shakh-cs Sep 24, 2026
ba5df9d
docs(readme): describe V2 as shipped and generate its command reference
naeem-shakh-cs Sep 24, 2026
c352c8c
chore(talisman): drop dead entries and narrow every blanket content e…
naeem-shakh-cs Sep 24, 2026
944d5e8
fix(projects): keep a --config file inside the data dir out of the Fi…
naeem-shakh-cs Sep 24, 2026
5ebffb6
refactor(functions): import the Express type as a type
naeem-shakh-cs Sep 24, 2026
6c14633
docs(agents): make every claim true and add the ninth testing rule
naeem-shakh-cs Sep 24, 2026
0fda5d8
refactor(organizations): type the picker answer as the null it is gua…
naeem-shakh-cs Sep 24, 2026
f77239b
fix(functions): load the bundler only when a function is bundled
naeem-shakh-cs Sep 24, 2026
ad67e00
fix(test): start every test without a terminal and never block on a r…
naeem-shakh-cs Sep 24, 2026
18a0959
chore(deps): declare winston as a runtime dependency for the serve lo…
naeem-shakh-cs Sep 24, 2026
3b57ba2
feat(functions): port the v1 serve logger that writes logs/info.log a…
naeem-shakh-cs Sep 24, 2026
a25bbff
feat(functions): record the serve invalid-port error in the project l…
naeem-shakh-cs Sep 24, 2026
c48c84e
chore(git): ignore the logs folder functions:serve writes
naeem-shakh-cs Sep 24, 2026
bf9a139
fix(functions): let PORT beat --port and exit 1 on a bad port as v1 did
naeem-shakh-cs Sep 24, 2026
cf8802c
docs(functions): describe serve's v1 port precedence and exit 1
naeem-shakh-cs Sep 24, 2026
2719a61
fix(transport): send a JSON content type only on a request that has a…
naeem-shakh-cs Sep 24, 2026
0f81593
fix(projects): read signed-upload form fields as formFieldKey and for…
naeem-shakh-cs Sep 24, 2026
7b5dccb
fix(core): register the searchable picker so every picker lists its c…
naeem-shakh-cs Sep 24, 2026
21cb988
fix(core): exit 3 as cancelled when Ctrl-C is pressed at a prompt
naeem-shakh-cs Sep 24, 2026
e4dcd33
fix(projects): find --repo given as <namespace>/<repository>
naeem-shakh-cs Sep 24, 2026
d75233b
fix(deployments): draw the heartbeat only when stdout is a terminal
naeem-shakh-cs Sep 24, 2026
1d5839e
fix(core): submit the typed text when a picker search matches nothing
naeem-shakh-cs Sep 24, 2026
e3b5311
test(core): guard that every prompt type in src is registered with th…
naeem-shakh-cs Sep 24, 2026
ba94df3
test(transport): guard the content type of every method the client ca…
naeem-shakh-cs Sep 24, 2026
f6be8a6
test(core): guard that only the decision to prompt reads stdin's term…
naeem-shakh-cs Sep 24, 2026
3359afb
test(core): guard that every prompt goes through the Ctrl-C wrapper
naeem-shakh-cs Sep 24, 2026
2071178
docs(agents): close a live-harness defect only with a regression and …
naeem-shakh-cs Sep 24, 2026
164894b
fix(transport): send no content type on any bodyless request
naeem-shakh-cs Sep 24, 2026
17bef75
fix: address the independent review of the skeleton and the Projects …
naeem-shakh-cs Sep 24, 2026
692a62b
docs: record the review fixes in AGENTS.md and fix the beta install line
naeem-shakh-cs Sep 24, 2026
b7e6792
fix(projects): give up on a FileUpload upload that stalls instead of …
naeem-shakh-cs Sep 25, 2026
3e378be
feat(deployments): stream the build logs while waiting on a deployment
Harshi-Shah-CS Sep 25, 2026
921cd1d
docs(agents): describe the build-log stream in the deployment wait loop
Harshi-Shah-CS Sep 25, 2026
23a17de
feat(projects): bring create's output to V1 parity and refuse an over…
Harshi-Shah-CS Sep 25, 2026
b2ebaad
chore(talisman): allow the key-named lines in the upload and presente…
Harshi-Shah-CS Sep 25, 2026
58c9204
refactor(config): keep only uid and organizationUid in .cs-launch.json
SakshiKoli-CS Sep 28, 2026
a70fc89
feat(projects): take the GitHub repository from the local working copy
SakshiKoli-CS Sep 28, 2026
bedaae0
feat(deployments): keep the build log's own colours and stamp it with…
SakshiKoli-CS Sep 29, 2026
8674855
test: pin stdout so the suite reads the same in a terminal as when piped
SakshiKoli-CS Sep 29, 2026
5282362
feat(projects): prompt for the fields projects:update was not given
Harshi-Shah-CS Sep 29, 2026
787f209
feat(projects): ask delete the way the Contentstack CLI does and repo…
Harshi-Shah-CS Sep 29, 2026
e06460f
feat(projects): send a supplied update flag as the whole request
Harshi-Shah-CS Sep 29, 2026
f943170
feat(projects): ask create's project type as "Choose a project type t…
Harshi-Shah-CS Sep 30, 2026
8c06b71
chore(talisman): allow the delete, confirm and project-inputs files b…
Harshi-Shah-CS Sep 30, 2026
e0c34cf
feat(projects): draw projects:list and projects:get as a bordered table
SakshiKoli-CS Sep 30, 2026
1910e84
fix(projects): default create's environment name to "Default"
SakshiKoli-CS Sep 30, 2026
510f6d8
fix(projects): point a missing GitHub connection at the page that fix…
SakshiKoli-CS Sep 30, 2026
00da9fa
chore(talisman): refresh the layering and launch-command checksums
SakshiKoli-CS Sep 30, 2026
6d091a5
feat(functions): list the served routes above a clickable serving url
Harshi-Shah-CS Sep 30, 2026
931929d
test(projects): cover the two missing-connection branches CI flagged
Harshi-Shah-CS Sep 30, 2026
7522994
feat(projects): show a progress bar while the project zip uploads
SakshiKoli-CS Sep 30, 2026
8e3a754
test(git): unit-test isMissingGitConnection, which had no test file
SakshiKoli-CS Sep 30, 2026
acd6d16
feat(projects): warn on GitHub-only flags and offer a rename on a tak…
Harshi-Shah-CS Oct 1, 2026
cc985e9
fix(projects): report create failures in V1's words and refuse what t…
Harshi-Shah-CS Oct 1, 2026
8756979
fix(git): read a remote url that carries a username
SakshiKoli-CS Oct 5, 2026
f693537
feat(core): say which values came from the project config file
Harshi-Shah-CS Oct 5, 2026
930234b
fix(projects): send the FileUpload zip through the configured proxy, …
Harshi-Shah-CS Oct 6, 2026
366257f
fix(prompts): never answer a prompt with something that is not on its…
SakshiKoli-CS Oct 6, 2026
7a4fd03
Merge remote-tracking branch 'origin/feature/development-v2' into fea…
SakshiKoli-CS Oct 6, 2026
21d2a1c
chore(talisman): refresh the project-inputs checksum this change inva…
SakshiKoli-CS Oct 6, 2026
4a96140
refactor(prompts): move the shared prompt helpers into core/prompt an…
Harshi-Shah-CS Oct 6, 2026
795473d
fix(prompts): refuse a blank answer and trim the spaces around names,…
Harshi-Shah-CS Oct 6, 2026
8f16658
fix(git): fall back to origin when the checked-out branch tracks a lo…
Harshi-Shah-CS Oct 7, 2026
89b0a3f
refactor(core): drop the exit code constant nothing could use
SakshiKoli-CS Oct 7, 2026
4d7936f
feat(projects): open the live site in the browser once create's deplo…
Harshi-Shah-CS Oct 7, 2026
844b408
chore(lint): enforce the formatting rules the config was silently mis…
SakshiKoli-CS Oct 7, 2026
a47c965
feat(projects): bring back V1's GitHub connection check, project name…
Harshi-Shah-CS Oct 7, 2026
4af65b4
fix(projects): stop advising --config when create finds a linked folder
SakshiKoli-CS Oct 7, 2026
74c8860
fix(deployments): stop dropping build log lines that share a millisecond
SakshiKoli-CS Oct 7, 2026
a880b06
fix(projects): show projects:list's range from the requested --skip
SakshiKoli-CS Oct 7, 2026
70edd19
refactor: give each duplicated helper one shared definition
SakshiKoli-CS Oct 7, 2026
d0806a7
fix(lint): enforce no-explicit-any in src, and type the eight any's i…
SakshiKoli-CS Oct 7, 2026
ea74bc2
refactor(transport): name the envelope's member parameter member, not…
SakshiKoli-CS Oct 7, 2026
3e890d4
test(core): check which resources project.create imports, not how man…
SakshiKoli-CS Oct 7, 2026
267e63d
refactor(projects): let create's command import its resource's depend…
SakshiKoli-CS Oct 7, 2026
a92748d
test: move the repo-wide guard tests from src/core to test/guards
SakshiKoli-CS Oct 7, 2026
c187dbc
test: guard against an import loop through resources.ts
SakshiKoli-CS Oct 7, 2026
d9aaae1
test(integration): build the oclif config and console redirect in one…
SakshiKoli-CS Oct 7, 2026
ecb1587
refactor(git): delete the empty git.inputs.ts
SakshiKoli-CS Oct 7, 2026
b90b46b
refactor(functions): take serve's --data-dir from the shared catalog
SakshiKoli-CS Oct 7, 2026
8ed6ab1
refactor(environments): describe each framework in one row of one table
SakshiKoli-CS Oct 7, 2026
45fdb83
refactor(projects): split ProjectCreator by what each part of create …
SakshiKoli-CS Oct 7, 2026
41e8766
test(environments): pin the framework table to the service's values
SakshiKoli-CS Oct 7, 2026
12208ba
test: close three gaps the review found in the layering guards
SakshiKoli-CS Oct 7, 2026
7c44794
refactor(projects): move CreateRequest to types.ts and keep the creat…
SakshiKoli-CS Oct 8, 2026
625e436
feat(git): find the GitHub clone from a subfolder, worktree or submodule
Harshi-Shah-CS Oct 8, 2026
926d654
fix(git): name the account that owns the repository when it is not co…
SakshiKoli-CS Oct 8, 2026
507bf1b
refactor(deployments): pull the printed-log bookkeeping out of the wa…
SakshiKoli-CS Oct 9, 2026
2a4e053
refactor(projects): move the projects:update flow into ProjectUpdater
SakshiKoli-CS Oct 9, 2026
d256d32
refactor(deployments): split the reusable deployment follow out of pr…
SakshiKoli-CS Oct 9, 2026
9b53f6a
refactor(environments): move EnvironmentBuilder into the environments…
SakshiKoli-CS Oct 9, 2026
837a3ef
refactor(uploads): move the zip and upload out of projects into an up…
SakshiKoli-CS Oct 9, 2026
70e2208
feat(uploads): ask for the upload URL of a new environment or a deplo…
SakshiKoli-CS Oct 9, 2026
c9a1fbd
chore: refresh the Talisman checksums of the files the refactor edited
SakshiKoli-CS Oct 9, 2026
f98baaf
fix(projects): refuse an unconnected owner before asking for a projec…
SakshiKoli-CS Oct 9, 2026
e28809f
chore: merge v2-dev into feature/development-v2
SakshiKoli-CS Oct 12, 2026
06bcc89
chore: add Talisman checksums for the V2 files the PR secrets scan flags
SakshiKoli-CS Oct 13, 2026
9785757
refactor(transport): name the OAuth org config field for what it is
SakshiKoli-CS Oct 13, 2026
9913d5f
ci(secrets-scan): pass the PR refs to Talisman through env, not inline
SakshiKoli-CS Oct 13, 2026
b4ec390
fix(uploads): treat an empty upload url or uid as a malformed response
SakshiKoli-CS Oct 13, 2026
65d68e9
fix(core): stop isRecord from accepting arrays
SakshiKoli-CS Oct 13, 2026
f060623
fix(core): release the Ctrl-C listener when a prompt throws synchrono…
SakshiKoli-CS Oct 13, 2026
e6bb84d
Delete .github/workflows/secrets-scan.yml
Aravind-Kumar-cstk Oct 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,14 @@ jobs:
- run: npm ci
- name: Update npm
run: npm install -g npm@latest
- name: Determine npm dist-tag
id: dist-tag
run: |
version="$(node -p "require('./package.json').version")"
case "$version" in
*-alpha*|*-beta*|*-rc*) tag=beta ;;
*) tag=latest ;;
esac
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Release
run: npm publish --access public
run: npm publish --access public --tag ${{ steps.dist-tag.outputs.tag }}
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test
on:
pull_request:
branches: [feature/development-v2]
push:
branches: [feature/development-v2]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test:coverage
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ dependabot.yml
/bkp
.editorconfig
/functions
coverage/
coverage/
.compiled-loader-*/

# Holds a registry auth token. Never commit it.
.npmrc

# Written by functions:serve into the project directory, as V1 did.
logs/
10 changes: 4 additions & 6 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
npm run prepack && npm run lint-staged

echo "\n\n Running Talisman secret scan..."
talisman --githook pre-commit

echo "\n\n Running Snyk vulnerability scan..."
npm run prepack && npm run lint-staged && \
echo "\n\n Running secrets scan (Talisman + trufflehog)..." && \
sh .husky/secrets-scan.sh pre-commit && \
echo "\n\n Running Snyk vulnerability scan..." && \
snyk test --all-projects --fail-on=all
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npm run test
sh .husky/secrets-scan.sh pre-push "$@" && npm run test
146 changes: 146 additions & 0 deletions .husky/secrets-scan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#!/bin/sh
set -eu

cd "$(git rev-parse --show-toplevel)"

for tool in git curl tar mktemp awk xargs uname tr dirname; do
command -v "$tool" >/dev/null 2>&1 || { echo "secrets-scan: required tool '$tool' not found in PATH" >&2; exit 1; }
done
if ! command -v sha256sum >/dev/null 2>&1 && ! command -v shasum >/dev/null 2>&1; then
echo "secrets-scan: required tool 'sha256sum' or 'shasum' not found in PATH" >&2
exit 1
fi

HOOK_NAME="$1"

TALISMAN_VERSION="v1.37.0"
TRUFFLEHOG_VERSION="3.96.0"
CACHE_DIR="$HOME/.cache/secrets-scan-tools"
mkdir -p "$CACHE_DIR"

OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH_RAW=$(uname -m)
case "$ARCH_RAW" in
x86_64) ARCH=amd64 ;;
arm64|aarch64) ARCH=arm64 ;;
*) ARCH="$ARCH_RAW" ;;
esac

# Pinned checksums (from https://github.com/thoughtworks/talisman/releases/download/v1.37.0/checksums
# and https://github.com/trufflesecurity/trufflehog/releases/download/v3.96.0/trufflehog_3.96.0_checksums.txt),
# committed here rather than fetched at runtime - the whole point is to not trust a checksums file
# downloaded from the same release as the binary it's meant to verify.
case "${OS}_${ARCH}" in
darwin_amd64)
TALISMAN_SHA256="9a67e015d6c99650c45d653ce4a597f885bf661164c2671f08a3827013b277fb"
TRUFFLEHOG_SHA256="a30d8f1095e031a81a668e1582f2ed479c3b50476cef86317e0fb74210c33617"
;;
darwin_arm64)
TALISMAN_SHA256="4806746b2ba0190941f0606853990b4da6eb7df2d64c261212a6aa66eb6b15c2"
TRUFFLEHOG_SHA256="87478306b95ca2420cfb844b7582383ac60b922e262350a0088e797f328d2e62"
;;
linux_amd64)
TALISMAN_SHA256="8e0ae8bb7b160bf10c4fa1448beb04a32a35e63505b3dddff74a092bccaaa7e4"
TRUFFLEHOG_SHA256="7105f1cd6577f058a9e39d0578f1a99c8a1e481e4d3512cd8a09acfe22a0fdc0"
;;
linux_arm64)
TALISMAN_SHA256="ca706f428a45d7a4ed3cc5c3cf7b3e5b0dfce6f2f584000a117d0d602a0342b7"
TRUFFLEHOG_SHA256="50acd4c7a3b8ebfe5083d8350956057030c44be3515dedd55b45263495c490b2"
;;
*)
echo "secrets-scan: no pinned checksum for platform ${OS}_${ARCH} (talisman ${TALISMAN_VERSION} / trufflehog ${TRUFFLEHOG_VERSION})" >&2
exit 1
;;
esac

if command -v sha256sum >/dev/null 2>&1; then
checksum() { sha256sum "$1" | awk '{print $1}'; }
else
checksum() { shasum -a 256 "$1" | awk '{print $1}'; }
fi

TALISMAN_BIN="$CACHE_DIR/talisman_${TALISMAN_VERSION}_${OS}_${ARCH}"
if [ ! -x "$TALISMAN_BIN" ]; then
echo "secrets-scan: downloading Talisman ${TALISMAN_VERSION}..."
curl -fsSL -o "${TALISMAN_BIN}.tmp" "https://github.com/thoughtworks/talisman/releases/download/${TALISMAN_VERSION}/talisman_${OS}_${ARCH}"
ACTUAL_HASH=$(checksum "${TALISMAN_BIN}.tmp")
if [ "$ACTUAL_HASH" != "$TALISMAN_SHA256" ]; then
echo "secrets-scan: Talisman checksum verification FAILED" >&2
rm -f "${TALISMAN_BIN}.tmp"
exit 1
fi
mv "${TALISMAN_BIN}.tmp" "$TALISMAN_BIN"
chmod +x "$TALISMAN_BIN"
fi

TRUFFLEHOG_DIR="$CACHE_DIR/trufflehog_${TRUFFLEHOG_VERSION}_${OS}_${ARCH}"
TRUFFLEHOG_BIN="$TRUFFLEHOG_DIR/trufflehog"
if [ ! -x "$TRUFFLEHOG_BIN" ]; then
echo "secrets-scan: downloading trufflehog ${TRUFFLEHOG_VERSION}..."
mkdir -p "$TRUFFLEHOG_DIR"
TARBALL="$CACHE_DIR/trufflehog_${TRUFFLEHOG_VERSION}_${OS}_${ARCH}.tar.gz"
curl -fsSL -o "$TARBALL" "https://github.com/trufflesecurity/trufflehog/releases/download/v${TRUFFLEHOG_VERSION}/trufflehog_${TRUFFLEHOG_VERSION}_${OS}_${ARCH}.tar.gz"
ACTUAL_HASH=$(checksum "$TARBALL")
if [ "$ACTUAL_HASH" != "$TRUFFLEHOG_SHA256" ]; then
echo "secrets-scan: trufflehog checksum verification FAILED" >&2
rm -f "$TARBALL"
exit 1
fi
tar -xzf "$TARBALL" -C "$TRUFFLEHOG_DIR"
chmod +x "$TRUFFLEHOG_BIN"
fi

case "$HOOK_NAME" in
pre-commit)
"$TALISMAN_BIN" --githook pre-commit

STAGED_LIST=$(mktemp)
STAGE_DIR=$(mktemp -d)
trap 'rm -f "$STAGED_LIST"; rm -rf "$STAGE_DIR"' EXIT
git diff --cached --name-only --diff-filter=ACM -z > "$STAGED_LIST"
if [ -s "$STAGED_LIST" ]; then
export STAGE_DIR
xargs -0 sh -c 'for f; do mkdir -p "$STAGE_DIR/$(dirname "$f")"; git show ":$f" > "$STAGE_DIR/$f"; done' _ < "$STAGED_LIST"
"$TRUFFLEHOG_BIN" filesystem --fail --no-update --results=verified,unverified,unknown "$STAGE_DIR"
fi
;;
pre-push)
REMOTE_NAME="${2:-origin}"
STDIN_DATA=$(cat)
if [ -z "$STDIN_DATA" ]; then
exit 0
fi

DEFAULT_REF=$(git symbolic-ref -q --short "refs/remotes/${REMOTE_NAME}/HEAD" 2>/dev/null || echo "")
DEFAULT_BASE=""
[ -n "$DEFAULT_REF" ] && DEFAULT_BASE=$(git rev-parse --verify "$DEFAULT_REF" 2>/dev/null || echo "")
[ -z "$DEFAULT_BASE" ] && DEFAULT_BASE=$(git rev-parse --verify "${REMOTE_NAME}/main" 2>/dev/null || echo "")
[ -z "$DEFAULT_BASE" ] && DEFAULT_BASE=$(git rev-parse --verify "${REMOTE_NAME}/master" 2>/dev/null || echo "")

RESOLVED_STDIN=""
while read -r LOCAL_REF LOCAL_SHA REMOTE_REF REMOTE_SHA; do
[ -z "$LOCAL_SHA" ] && continue
[ "$LOCAL_SHA" = "0000000000000000000000000000000000000000" ] && continue
if [ -z "$REMOTE_SHA" ] || [ "$REMOTE_SHA" = "0000000000000000000000000000000000000000" ]; then
REMOTE_SHA="$DEFAULT_BASE"
fi
if [ -z "$REMOTE_SHA" ]; then
echo "secrets-scan: could not determine a base commit to scan ${LOCAL_REF} against (no ${REMOTE_NAME}/HEAD, ${REMOTE_NAME}/main, or ${REMOTE_NAME}/master found locally) - refusing to silently skip the scan. Run 'git fetch ${REMOTE_NAME}' and try again." >&2
exit 1
fi
RESOLVED_STDIN="${RESOLVED_STDIN}${LOCAL_REF} ${LOCAL_SHA} ${REMOTE_REF} ${REMOTE_SHA}
"
"$TRUFFLEHOG_BIN" git "file://$(pwd)" --since-commit "$REMOTE_SHA" --branch "$LOCAL_SHA" --fail --no-update --results=verified,unverified,unknown
done <<EOF
$STDIN_DATA
EOF

if [ -n "$RESOLVED_STDIN" ]; then
printf '%s' "$RESOLVED_STDIN" | "$TALISMAN_BIN" --githook pre-push
fi
;;
*)
echo "secrets-scan: unknown hook '$HOOK_NAME'" >&2
exit 1
;;
esac
12 changes: 0 additions & 12 deletions .mocharc.json

This file was deleted.

Loading
Loading