Skip to content

Fix payload generation to use actual form data#144

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/form-data-usage
Oct 13, 2025
Merged

Fix payload generation to use actual form data#144
github-actions[bot] merged 1 commit into
mainfrom
fix/form-data-usage

Conversation

@ishaileshpant

Copy link
Copy Markdown
Collaborator

🐛 Problem

The GitHub Actions validation was failing because the bot API was generating payload files with hardcoded default values instead of using the actual form data:

  • Expected: repo: "prepguides/go-interviews", path: "patterns/README.md"
  • Actual: repo: "prepguides/prepguides.dev", path: "content/system-design/system-design-concurrency-model.md"

This caused the validation to fail with a 404 error because it was looking for a file that doesn't exist in the wrong repository.

✅ Solution

Updated the generatePayloadContent function in api/github/create-content-pr.js to use the actual form data:

content: {
    id: contentData.id,
    title: contentData.title,
    description: contentData.description,
    repo: contentData.repo || "prepguides/prepguides.dev", // Use form data or default
    path: contentData.path || `content/${contentData.category}/${contentData.id}.md`, // Use form data or default
    type: contentData.type || "guide", // Use form data or default
    status: "active"
},

🧪 Testing

  • ✅ Verified payload now correctly uses repo: "prepguides/go-interviews"
  • ✅ Verified payload now correctly uses path: "patterns/README.md"
  • ✅ Verified payload now correctly uses type: "Guide (GitHub Markdown)"

📝 Expected Result

The GitHub Actions validation should now pass because it will be looking for the correct file in the correct repository:

  • ✅ Repository accessible: prepguides/go-interviews
  • ✅ File accessible: prepguides/go-interviews/patterns/README.md

🔍 Additional Changes

  • Added logging to show repo, path, and type values being received for better debugging
  • Maintains backward compatibility with fallback defaults if form data is missing

- Use contentData.repo and contentData.path from form instead of hardcoded defaults
- Add logging to show repo, path, and type values being received
- This fixes the validation error where wrong path was being used
- Now payload will use actual form values: repo='prepguides/go-interviews', path='patterns/README.md'
- Resolves GitHub Actions validation failure with 404 errors
@vercel

vercel Bot commented Oct 13, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
prepguides-dev Ready Ready Preview Comment Oct 13, 2025 6:14pm

@ishaileshpant

Copy link
Copy Markdown
Collaborator Author

/approve

@github-actions github-actions Bot merged commit 42821af into main Oct 13, 2025
11 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Admin-Approved and Auto-Merged!

This PR has been automatically merged to main after admin approval by @ishaileshpant.

✅ **Status**: Merged and deployed
🔗 **Commit**: `42821afcc9a583ff207e39bcc6b6a92b1cbdaba5`
📅 **Merged at**: 2025-10-13T18:15:00.951Z
👤 **Approved by**: Admin/Maintainer/Owner

Thank you for your contribution! 🎉

@ishaileshpant ishaileshpant deleted the fix/form-data-usage branch October 13, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant