Skip to content

Commit

Permalink
chore: merged develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Jul 1, 2024
2 parents fcfd3d6 + 3a7066b commit 4abf7c5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { KnipConfig } from "knip";
const config: KnipConfig = {
entry: ["src/worker.ts"],
project: ["src/**/*.ts"],
ignoreBinaries: ["build", "i", "format:cspell", "awk", "lsof"],
ignoreBinaries: ["i"],
ignoreExportsUsedInFile: true,
ignoreDependencies: ["@mswjs/data", "esbuild", "eslint-config-prettier", "eslint-plugin-prettier", "msw"],
};
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ jobs:
bun setup-kv
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: "3.57.0"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
WEBHOOK_PROXY_URL
WEBHOOK_SECRET
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/knip-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ on:
types:
- completed

permissions: write-all

jobs:
knip-reporter:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'success' }}
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -26,7 +25,6 @@ jobs:
trim: true

- name: Report knip results to pull request
if: ${{ github.event.workflow_run.conclusion != 'success' }}
uses: gitcoindev/knip-reporter@main
with:
verbose: true
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Knip

on:
pull_request:
workflow_dispatch:

jobs:
run-knip:
Expand All @@ -16,10 +15,10 @@ jobs:
with:
node-version: 20.10.0

- uses: oven-sh/setup-bun@v1

- name: Install toolchain
run: bun install
run: |
npm i -g bun
bun install
- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt
Expand Down
Binary file modified bun.lockb
Binary file not shown.
4 changes: 3 additions & 1 deletion deploy/setup-kv-namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ async function main() {
let namespaceId: string;
try {
const res = execSync(`wrangler kv:namespace create ${NAMESPACE_TITLE}`).toString();
console.log(res);
const newId = res.match(/id = \s*"([^"]+)"/)?.[1];
if (!newId) {
throw new Error(`The new ID could not be found.`);
}
namespaceId = newId;
console.log(`Namespace created with ID: ${namespaceId}`);
} catch (error) {
console.error(error);
const listOutput = JSON.parse(execSync(`wrangler kv:namespace list`).toString()) as Namespace[];
const existingNamespace = listOutput.find((o) => o.title === NAMESPACE_TITLE_WITH_PREFIX);
if (!existingNamespace) {
Expand All @@ -99,6 +101,6 @@ async function main() {
main()
.then(() => console.log("Successfully bound namespace."))
.catch((e) => {
console.error("Error checking or creating namespace:", e);
console.error("Error checking or creating namespace:\n", e);
process.exit(1);
});

0 comments on commit 4abf7c5

Please sign in to comment.