Skip to content

Commit

Permalink
fix: update the deploy.yml and build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Jan 4, 2025
1 parent f6eb70b commit 624bf22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ jobs:
steps:
- name: Update environment secrets in Cloudflare
run: |
REPO_NAME=$(echo "${{ github.event.repository.name }}" | tr '.' '-')
REPOSITORY_NAME=${{ github.repository }}
REPOSITORY_NAME=${REPOSITORY_NAME//./-}
curl -X PUT \
"https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/${REPO_NAME}/deployment_configs" \
"https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/" + ${REPOSITORY_NAME} + "/deployment_configs" \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
-H "Content-Type: application/json" \
--data '{
Expand Down
10 changes: 5 additions & 5 deletions functions/issue-scraper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Context, Env } from "./types";
import { Context } from "./types";

export const corsHeaders = {
"Access-Control-Allow-Origin": "*",
Expand All @@ -7,16 +7,16 @@ export const corsHeaders = {
};



export async function onRequest(ctx: Context, env: Env): Promise<Response> {
const { request } = ctx;
export async function onRequest(ctx: Context): Promise<Response> {
const { request, env } = ctx;
const url = new URL(request.url);

try {
switch (request.method) {
case "GET":
if (url.searchParams.has("key")) {
const key = url.searchParams.get("key") as string;
return new Response("GET request with key: " + key + JSON.stringify(env.SUPABASE_ANON_KEY), {
return new Response("GET request with key: " + key + JSON.stringify(env), {
headers: corsHeaders,
status: 200,
});
Expand Down

0 comments on commit 624bf22

Please sign in to comment.