Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adds scraper logic and token handling #190

Open
wants to merge 32 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9f22bfb
fix: adds scraper logic and token handling
sshivaditya Dec 27, 2024
264701a
fix: supabase cleanup
sshivaditya Dec 28, 2024
1e206d5
fix: env
sshivaditya Dec 29, 2024
d038a0b
fix: base scraper function
sshivaditya Jan 3, 2025
7766a20
fix: update the deploy.yml
sshivaditya Jan 3, 2025
cbabb43
fix: update the deploy.yml
sshivaditya Jan 3, 2025
eb012dc
fix: update the deploy.yml
sshivaditya Jan 3, 2025
94fef8c
fix: update the deploy.yml
sshivaditya Jan 3, 2025
bb38ea4
fix: update the deploy.yml and build.yml
sshivaditya Jan 3, 2025
f6eb70b
fix: update the deploy.yml and build.yml
sshivaditya Jan 4, 2025
624bf22
fix: update the deploy.yml and build.yml
sshivaditya Jan 4, 2025
ae6bd0e
fix: update the deploy.yml and build.yml
sshivaditya Jan 4, 2025
4fab7cf
fix: update deploy.yml
sshivaditya Jan 4, 2025
fd34c82
fix: update deploy.yml
sshivaditya Jan 4, 2025
c6efe22
fix: update deploy.yml
sshivaditya Jan 4, 2025
685122a
fix: deploy env script
sshivaditya Jan 4, 2025
b607041
fix: deploy env script
sshivaditya Jan 4, 2025
8f8cadf
fix: update env script
sshivaditya Jan 4, 2025
f8c0be9
fix: update env script
sshivaditya Jan 4, 2025
60ee890
fix: update env script
sshivaditya Jan 4, 2025
fb03b1f
fix: update env script, scraper function deploys on cloudflare
sshivaditya Jan 4, 2025
6f49eba
fix: removing org subs check temp
sshivaditya Jan 4, 2025
ed3ad2e
fix: removing org subs check temp
sshivaditya Jan 4, 2025
b53a607
fix: reduce the number of requests by batching
sshivaditya Jan 4, 2025
5e04669
fix: added back the org subs check
sshivaditya Jan 4, 2025
b2dabcd
fix: timestamp based issue scraping
sshivaditya Jan 4, 2025
13424e4
fix: timestamp based issue scraping
sshivaditya Jan 4, 2025
8f3b4e6
fix: tsconfig and auth cleanup
sshivaditya Jan 6, 2025
3ed6c54
fix: throw error when issue.title is empty
sshivaditya Jan 6, 2025
d80b712
fix: handle the failures where the issue.title is missing
sshivaditya Jan 6, 2025
609db1f
fix: graphql lint and bun.lockdb del
sshivaditya Jan 10, 2025
91fb9e7
fix: graphql formatting
sshivaditya Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/sync-env-vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

# Check if required environment variables are set
if [ -z "$CLOUDFLARE_ACCOUNT_ID" ] || [ -z "$CLOUDFLARE_API_TOKEN" ] || [ -z "$GITHUB_REPOSITORY" ] || \
[ -z "$VOYAGEAI_API_KEY" ] || [ -z "$SUPABASE_URL" ] || [ -z "$SUPABASE_KEY" ]; then
echo "Error: Required environment variables are not set"
exit 1
fi

# Extract just the repository name from org/repo format
REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2)
# Replace dots with hyphens
REPOSITORY_NAME=${REPOSITORY_NAME//./-}

# Echo the repository name
echo "Repository name: $REPOSITORY_NAME"

# Make the API call to Cloudflare
curl -X PATCH \
"https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/pages/projects/${REPOSITORY_NAME}/deployment_configs" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \
-H "Content-Type: application/json" \
--data '{
"deployment_configs": {
"production": {
"env_vars": {
"VOYAGEAI_API_KEY": {
"value": "'"${VOYAGEAI_API_KEY}"'",
"type": "secret_text"
},
"SUPABASE_URL": {
"value": "'"${SUPABASE_URL}"'",
"type": "secret_text"
},
"SUPABASE_KEY": {
"value": "'"${SUPABASE_KEY}"'",
"type": "secret_text"
}
}
}
}
}'
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: static
path: static
path: |
static
functions
package.json
yarn.lock
24 changes: 22 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,25 @@ jobs:
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
commit_sha: ${{ github.event.workflow_run.head_sha }}
workflow_run_id: ${{ github.event.workflow_run.id }}
app_id: ${{ secrets.APP_ID }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
statics_directory: "static"

update_env_secrets_in_cloudflare:
name: Update environment secrets in Cloudflare
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Make script executable
run: chmod +x .github/sync-env-vars.sh

- name: Run sync environment variables script
env:
GITHUB_REPOSITORY: ${{ github.repository }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
VOYAGEAI_API_KEY: ${{ secrets.VOYAGEAI_API_KEY }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
run: bash .github/sync-env-vars.sh

Empty file modified bun.lockb
100755 → 100644
Empty file.
Loading
Loading