Loading files
5e4094a64This file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/stack-chan-374381865.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
5e4094a64This file is pinned to the selected release. Download the original to open it in your design tool.
#!/usr/bin/env node
import { resolve } from 'node:path'
import { pathToFileURL } from 'node:url'
export function validateCloudflareConfig(environment = process.env) {
const required = ['CLOUDFLARE_ACCOUNT_ID', 'CLOUDFLARE_API_TOKEN', 'CLOUDFLARE_PAGES_PROJECT']
for (const name of required) {
if (!environment[name]) throw new Error(`GitHub Actions setting ${name} is not configured`)
}
if (!/^[0-9a-f]{32}$/.test(environment.CLOUDFLARE_ACCOUNT_ID)) {
throw new Error('CLOUDFLARE_ACCOUNT_ID must be a 32-character hexadecimal ID')
}
if (!/^[a-z0-9][a-z0-9-]*$/.test(environment.CLOUDFLARE_PAGES_PROJECT)) {
throw new Error('CLOUDFLARE_PAGES_PROJECT contains unsupported characters')
}
}
const isMain = process.argv[1] && pathToFileURL(resolve(process.argv[1])).href === import.meta.url
if (isMain) {
try {
validateCloudflareConfig()
console.log('Validated Cloudflare Pages configuration')
} catch (error) {
console.error(`::error::${error instanceof Error ? error.message : error}`)
process.exit(1)
}
}