Skip to content

Commit bd19aa6

Browse files
committed
Preserve Cloudflare asset ignore in deploy artifact
1 parent e4e7679 commit bd19aa6

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎.github/workflows/deploy-production.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ jobs:
6666

6767
- name: Create the verified asset manifest
6868
run: |
69+
test "$(find dist/client -type f -path '*/.*' ! -path 'dist/client/.assetsignore' -print -quit)" = ''
70+
printf 'wrangler.json\n.dev.vars\n' \
71+
| diff --unified - dist/client/.assetsignore
6972
find dist/client -type f -print0 \
7073
| sort -z \
7174
| xargs -0 sha256sum > production-assets.sha256
@@ -79,6 +82,7 @@ jobs:
7982
dist/client
8083
production-assets.sha256
8184
if-no-files-found: error
85+
include-hidden-files: true
8286
retention-days: 1
8387

8488
backend:

‎scripts/orbit-production-config-tests.mjs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ assert(
241241
&& deployWorkflow.includes('actions/download-artifact@v7'),
242242
'verified production assets are not handed to the deploy job as an artifact',
243243
);
244+
assert(
245+
deployWorkflow.includes("! -path 'dist/client/.assetsignore'")
246+
&& deployWorkflow.includes("printf 'wrangler.json\\n.dev.vars\\n'")
247+
&& deployWorkflow.includes('include-hidden-files: true'),
248+
'production artifact does not safely preserve the exact Cloudflare .assetsignore file',
249+
);
244250
assert(
245251
deployWorkflow.includes('sha256sum --check production-assets.sha256'),
246252
'production asset checksum is not verified before deployment',

0 commit comments

Comments
 (0)