Initial commit

This commit is contained in:
2025-09-28 08:50:15 -07:00
committed by GitHub
commit f4d22df46b
7 changed files with 177 additions and 0 deletions

17
.github/workflows/auto-name.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
on: push
permissions: write-all
jobs:
j:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
n=${GITHUB_REPOSITORY#*/};n=$(echo $n|tr A-Z a-z)
jq ".name=\"$n\"" package.json>p.json && mv p.json package.json
sed -i "s/^name *=.*$/name = \"$n\"/" wrangler.toml
git diff --quiet || {
git config user.email a@a.a
git config user.name a
git commit -am update
git push
}

42
.github/workflows/bind-everything.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
on:
push:
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: npm install -g wrangler
- name: Fetch Cloudflare Account ID & Sync Bindings
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
export CLOUDFLARE_ACCOUNT_ID=$(curl -sX GET "https://api.cloudflare.com/client/v4/accounts" -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" -H "Content-Type:application/json" | jq -r '.result[0].id')
wrangler d1 list --json | jq -c '.[]' | while read -r db; do
id=$(jq -r .uuid <<< "$db")
if ! grep -q "$id" wrangler.toml; then
name=$(jq -r .name <<< "$db")
binding=$(echo "$name" | tr '[:lower:]-' '[:upper:]_')
printf '\n[[d1_databases]]\nbinding = "%s"\ndatabase_name = "%s"\ndatabase_id = "%s"\n' "$binding" "$name" "$id" >> wrangler.toml
fi
done
- name: Commit and Push Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Sync D1 database bindings"
file_pattern: wrangler.toml

11
.github/workflows/deep.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
on:
workflow_dispatch:
push:
jobs:
deploy-cloudflare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}