Skip to content

Commit 6b907b1

Browse files
committed
ci: Add locked-in tool; fix violations
Adds https://github.com/asymmetric-research/locked-in as a CI workflow using the config from the main Guardian repo. Fixes violations: - Use a lockfile where available - Add a few ignore directives for false positives
1 parent aa4bec1 commit 6b907b1

6 files changed

Lines changed: 36 additions & 3 deletions

File tree

.github/workflows/locked-in.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: locked-in
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
locked-in:
17+
runs-on: ubuntu-latest
18+
env:
19+
LOCKED_IN_COMMIT: 7978ff8e3717a30c18352ab1eb687e5f8210a5ac # v0.3.1
20+
steps:
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
24+
- name: Install locked-in from pinned source
25+
run: cargo install --locked --git https://github.com/asymmetric-research/locked-in --rev "$LOCKED_IN_COMMIT" locked-in
26+
- name: Run locked-in
27+
run: locked-in

.github/workflows/prettier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
echo "Actual Prettier version: $ACTUAL_VERSION"
4141
if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then
4242
echo "Error: Prettier version mismatch!"
43-
echo "This usually means bun.lock is out of sync with package.json - try running 'bun install' locally and committing the updated bun.lock"
43+
echo "bun.lock is out of sync with package.json — regenerate it and commit the result"
4444
exit 1
4545
fi
4646
echo "✓ Prettier version matches"

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Do not change the dependencies of the package.json by hand!
2020
Instead:
2121

2222
- When initially installing OR pulling what has been changed: `bun ci`.
23+
<!-- locked-in: ignore[bun-frozen-lockfile] -->
2324
If you do not do this, you may not get exactly what is specified in the file, inadvertently update dependencies, or even pull exploits down to your machine! **Never use `bun install` for this use case**.
2425
- When needing to add or update a package: `bun add <package>@<version>`. If you do not do this, you may inadvertently update other packages or fail to update the lock file.
2526
- When needing to remove a package: `bun remove <package>`. If you do not do this, you may inadvertently update other packages or fail to update the lock file.

cli/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function select_branch {
147147
function install_cli {
148148
cd "$1"
149149

150-
bun install
150+
bun install --frozen-lockfile
151151

152152
# Build using root script which handles dependency ordering
153153
# (sdk-definitions-ntt must be built before other packages)

sdk/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The NTT TypeScript SDK is is a collection of packages that provide a simple inte
77
From this directory, install package dependencies and build contract dependencies
88

99
```bash
10+
<!-- locked-in: ignore[bun-frozen-lockfile] -->
1011
bun install
1112
bun run build:deps
1213
```
@@ -16,9 +17,13 @@ bun run build:deps
1617
The SDK contains multiple packages. The `@wormhole-foundation/sdk-definitions-ntt` package contains the NTT interface and types. The `@wormhole-foundation/sdk-evm-ntt` and `@wormhole-foundation/sdk-solana-ntt` packages contain the EVM and Solana implementations of the NTT interface, respectively. Install one or both of these packages, depending on which platforms you want to interact with. The `@wormhole-foundation/sdk-route-ntt` package contains the Wormhole SDK `Route` for NTT (more on this in the Usage section).
1718

1819
```bash
20+
<!-- locked-in: ignore[bun-version-pin] -->
1921
bun add @wormhole-foundation/sdk-definitions-ntt
22+
<!-- locked-in: ignore[bun-version-pin] -->
2023
bun add @wormhole-foundation/sdk-evm-ntt
24+
<!-- locked-in: ignore[bun-version-pin] -->
2125
bun add @wormhole-foundation/sdk-solana-ntt
26+
<!-- locked-in: ignore[bun-version-pin] -->
2227
bun add @wormhole-foundation/sdk-route-ntt
2328
```
2429

solana/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ clean:
6060
rm -rf .anchor node_modules
6161

6262
node_modules:
63-
bun install
63+
bun install --frozen-lockfile
6464

6565

6666
#######################

0 commit comments

Comments
 (0)