-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor GitHub OAuth environment variables and update CI/CD workflow… #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7ec7995
Refactor GitHub OAuth environment variables and update CI/CD workflow…
Lathiya50 896eb68
Remove VPS deployment workflow from GitHub Actions
Lathiya50 ad71e83
Update pnpm version to 10 in CI/CD workflows for consistency
Lathiya50 04e8f4c
Add pre-push hook for build verification and remove unused SVG files
Lathiya50 16ce603
Refactor pre-push hook to include lint checks and optimize review com…
Lathiya50 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| name: CI / CD | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| ci: | ||
| name: Lint, Type-check & Build | ||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | ||
| BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }} | ||
| BETTER_AUTH_URL: ${{ secrets.BETTER_AUTH_URL }} | ||
| NEXT_PUBLIC_APP_URL: ${{ secrets.NEXT_PUBLIC_APP_URL }} | ||
| GH_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }} | ||
| GH_CLIENT_SECRET: ${{ secrets.GH_CLIENT_SECRET }} | ||
| GH_WEBHOOK_SECRET: ${{ secrets.GH_WEBHOOK_SECRET }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} | ||
| INNGEST_EVENT_KEY: ${{ secrets.INNGEST_EVENT_KEY }} | ||
| INNGEST_SIGNING_KEY: ${{ secrets.INNGEST_SIGNING_KEY }} | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10 | ||
| run_install: false | ||
|
|
||
| - name: Setup Node.js 20 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Generate Prisma Client | ||
| run: pnpm db:generate | ||
|
|
||
| - name: Lint | ||
| run: pnpm lint | ||
|
|
||
| - name: Build | ||
| run: pnpm build | ||
|
|
||
| deploy: | ||
| name: Deploy to Vercel (Production) | ||
| runs-on: ubuntu-latest | ||
| needs: ci | ||
| # Only deploy on direct pushes to main — not on pull requests | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
|
|
||
| env: | ||
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | ||
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10 | ||
| run_install: false | ||
|
|
||
| - name: Setup Node.js 20 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Install Vercel CLI | ||
| run: npm i -g vercel@latest | ||
|
|
||
| - name: Pull Vercel environment variables | ||
| run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | ||
|
|
||
| - name: Build project via Vercel | ||
| run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | ||
|
|
||
| - name: Deploy prebuilt project to Vercel | ||
| run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| echo "Running lint check..." | ||
|
|
||
| pnpm run lint | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "Lint failed! Push aborted." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Lint passed. Running build..." | ||
|
|
||
| pnpm run build | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "Build failed! Push aborted." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Lint and build succeeded. Proceeding with push." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI workflow uses secrets without fallbacks, breaking builds
High Severity
The
cijob env vars reference${{ secrets.* }}without fallback values, so they resolve to empty strings when secrets aren't configured (e.g., fork PRs or new repo setups). Thedeploy-vps.ymlin the same repo correctly uses thesecrets.X != '' && secrets.X || 'fallback'pattern, and the documentation added in this same PR (section 8.1) explicitly recommends hardcoded placeholder values with the comment "Build-time placeholders (same idea as Dockerfile)." The actual workflow contradicts both patterns and will fail the build.Additional Locations (1)
docs/vercel_deployment_epic.md#L383-L396