Skip to content

Commit 3afb916

Browse files
authored
Merge pull request #448 from webstackdev/maintenance/cleandup-deps
Remove unused dependencies and update vitest
2 parents 44de3f3 + 84e9149 commit 3afb916

7 files changed

Lines changed: 342 additions & 768 deletions

File tree

.github/pull_request_template.md

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,3 @@
1919
## Changes Made
2020

2121
<!-- List the main changes in this PR -->
22-
23-
-
24-
-
25-
-
26-
27-
## Related Issues
28-
29-
<!-- Link to related issues, e.g., Closes #123, Fixes #456 -->
30-
31-
Closes #
32-
33-
## Testing
34-
35-
<!-- Describe the testing you've done -->
36-
37-
- [ ] Unit tests pass locally (`npm run test:unit`)
38-
- [ ] E2E tests pass locally (`npm run test:e2e:ready`)
39-
- [ ] Linting passes (`npm run lint`)
40-
- [ ] Build succeeds (`npm run build`)
41-
- [ ] Manually tested in browser
42-
43-
## Screenshots (if applicable)
44-
45-
<!-- Add screenshots for UI changes -->
46-
47-
## Checklist
48-
49-
- [ ] My branch name follows the conventions (feature/*, bugfix/*, etc.)
50-
- [ ] My code follows the project's coding standards
51-
- [ ] I have performed a self-review of my code
52-
- [ ] I have commented my code, particularly in hard-to-understand areas
53-
- [ ] I have made corresponding changes to the documentation
54-
- [ ] My changes generate no new warnings or errors
55-
- [ ] I have added tests that prove my fix is effective or that my feature works
56-
- [ ] New and existing unit tests pass locally with my changes
57-
- [ ] Any dependent changes have been merged and published
58-
59-
## Additional Notes
60-
61-
<!-- Any additional information that reviewers should know -->

.github/workflows/build-and-test.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ jobs:
1111
name: Build and Test
1212
runs-on: ubuntu-latest
1313

14+
# Define environment variables once at the job level
15+
# These will be available to ALL steps in this job
16+
env:
17+
CONVERTKIT_API_KEY: ${{ secrets.CONVERTKIT_API_KEY }}
18+
CONVERTKIT_FORM_ID: ${{ secrets.CONVERTKIT_FORM_ID }}
19+
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
20+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
21+
PUBLIC_SENTRY_DSN: ${{ secrets.PUBLIC_SENTRY_DSN }}
22+
WEBMENTION_IO_TOKEN: ${{ secrets.WEBMENTION_IO_TOKEN }}
23+
1424
steps:
1525
- name: Checkout repository
1626
uses: actions/checkout@v4
@@ -22,7 +32,7 @@ jobs:
2232
cache: 'npm'
2333

2434
- name: Install dependencies
25-
run: npm ci
35+
run: npm ci --legacy-peer-deps
2636

2737
- name: Run TypeScript check
2838
run: npm run check

.github/workflows/type-check.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ jobs:
1111
name: Code Quality Check
1212
runs-on: ubuntu-latest
1313

14+
# Define environment variables once at the job level
15+
# These will be available to ALL steps in this job
16+
env:
17+
CONVERTKIT_API_KEY: ${{ secrets.CONVERTKIT_API_KEY }}
18+
CONVERTKIT_FORM_ID: ${{ secrets.CONVERTKIT_FORM_ID }}
19+
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
20+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
21+
PUBLIC_SENTRY_DSN: ${{ secrets.PUBLIC_SENTRY_DSN }}
22+
WEBMENTION_IO_TOKEN: ${{ secrets.WEBMENTION_IO_TOKEN }}
23+
1424
steps:
1525
- name: Checkout repository
1626
uses: actions/checkout@v4
@@ -22,7 +32,7 @@ jobs:
2232
cache: 'npm'
2333

2434
- name: Install dependencies
25-
run: npm ci
35+
run: npm ci --legacy-peer-deps
2636

2737
- name: Run TypeScript check
2838
run: npm run check

docs/GITHUB_SECRETS_SETUP.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# GitHub Secrets Setup Guide
2+
3+
This document explains how to configure GitHub Secrets for CI/CD workflows.
4+
5+
## Required Secrets
6+
7+
The following secrets must be configured in your GitHub repository for the CI/CD pipelines to work:
8+
9+
### Required for Build & Deployment
10+
11+
- `CONVERTKIT_API_KEY` - ConvertKit API key for newsletter integration
12+
- `CONVERTKIT_FORM_ID` - ConvertKit form ID (numeric value)
13+
- `RESEND_API_KEY` - Resend API key for email functionality
14+
15+
### Required for Vercel Deployment
16+
17+
- `VERCEL_TOKEN` - Vercel deployment token
18+
- `VERCEL_PROJECT_ID` - Your Vercel project ID
19+
- `VERCEL_ORG_ID` - Your Vercel organization ID
20+
21+
### Optional but Recommended
22+
23+
- `SENTRY_AUTH_TOKEN` - Sentry authentication token (required for source map uploads)
24+
- `PUBLIC_SENTRY_DSN` - Sentry DSN for error tracking
25+
- `WEBMENTION_IO_TOKEN` - WebMention.io API token for webmentions
26+
27+
## How to Add Secrets to GitHub
28+
29+
1. Navigate to your repository on GitHub
30+
2. Click on **Settings** tab
31+
3. In the left sidebar, click **Secrets and variables****Actions**
32+
4. Click **New repository secret**
33+
5. Add each secret:
34+
- **Name**: Exact name from the list above (case-sensitive)
35+
- **Value**: The actual secret value from your local `.env` file
36+
- Click **Add secret**
37+
38+
## Security Features
39+
40+
GitHub Actions automatically:
41+
-**Masks secret values** in all log output
42+
-**Prevents secrets from being printed** to console
43+
-**Blocks secret exposure** in pull requests from forks
44+
-**Encrypts secrets** at rest and in transit
45+
46+
### Example of Masked Output
47+
If a secret contains `abc123xyz`, GitHub will show:
48+
```
49+
***
50+
```
51+
52+
## Workflow Configuration
53+
54+
The secrets are injected as environment variables in the workflow files:
55+
56+
### build-and-test.yml
57+
Secrets are available in these steps:
58+
- TypeScript check
59+
- Unit tests
60+
- Build
61+
- E2E tests
62+
63+
### type-check.yml
64+
Secrets are available in:
65+
- TypeScript check
66+
67+
## Local Development
68+
69+
For local development, create a `.env` file in the project root:
70+
71+
```bash
72+
# Copy from .env.example or create manually
73+
CONVERTKIT_API_KEY=your_key_here
74+
CONVERTKIT_FORM_ID=123456
75+
RESEND_API_KEY=your_key_here
76+
SENTRY_AUTH_TOKEN=your_token_here
77+
PUBLIC_SENTRY_DSN=your_dsn_here
78+
WEBMENTION_IO_TOKEN=your_token_here
79+
```
80+
81+
**Important**: `.env` files are gitignored and should NEVER be committed to the repository.
82+
83+
## Troubleshooting
84+
85+
### "Context access might be invalid" warnings
86+
These YAML lint warnings appear before secrets are added to GitHub. They will disappear once you configure the secrets in your repository settings.
87+
88+
### Build fails with "environment variable is not set"
89+
1. Verify the secret is added in GitHub Settings
90+
2. Check the secret name matches exactly (case-sensitive)
91+
3. Ensure the workflow file references the secret correctly: `${{ secrets.SECRET_NAME }}`
92+
93+
### Secret not available in job
94+
- Secrets are not passed to workflows triggered by forks
95+
- Check that the secret is configured at the repository level (not environment level)
96+
- Verify the job has access to secrets (jobs inherit by default)
97+
98+
## Best Practices
99+
100+
1. **Rotate secrets regularly** - Update secrets periodically for security
101+
2. **Use different secrets** for different environments (dev/staging/prod)
102+
3. **Limit secret access** - Only add secrets that are necessary
103+
4. **Document secret requirements** - Keep this file updated
104+
5. **Test in PR** - Ensure workflows work before merging to main
105+
106+
## Reference
107+
108+
- [GitHub Actions Secrets Documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets)
109+
- [Astro Environment Variables](https://docs.astro.build/en/guides/environment-variables/)

0 commit comments

Comments
 (0)