mirror of
https://github.com/f/awesome-chatgpt-prompts.git
synced 2025-06-06 18:30:59 +00:00
update
This commit is contained in:
parent
8886e7d1e2
commit
7fcfc01c7f
12
.github/workflows/ai_bot.yml
vendored
12
.github/workflows/ai_bot.yml
vendored
@ -196,7 +196,15 @@ jobs:
|
|||||||
console.log('Preparing content updates...');
|
console.log('Preparing content updates...');
|
||||||
// Remove markdown quote character and trim whitespace for both files
|
// Remove markdown quote character and trim whitespace for both files
|
||||||
const cleanPrompt = newPrompt.replace(/^>\s*/gm, '').trim();
|
const cleanPrompt = newPrompt.replace(/^>\s*/gm, '').trim();
|
||||||
const newSection = `## ${actName}\n${contributorInfo}\n\n> ${cleanPrompt}\n\n`;
|
|
||||||
|
// For README: Add quote to each line
|
||||||
|
const readmePrompt = cleanPrompt.split('\n')
|
||||||
|
.map(line => `> ${line.trim()}`)
|
||||||
|
.join('\n');
|
||||||
|
const newSection = `## ${actName}\n${contributorInfo}\n\n${readmePrompt}\n\n`;
|
||||||
|
|
||||||
|
// For CSV: Convert to single paragraph
|
||||||
|
const csvPrompt = cleanPrompt.replace(/\n+/g, ' ').trim();
|
||||||
|
|
||||||
// Insert the new section before Contributors in README
|
// Insert the new section before Contributors in README
|
||||||
let readmeContent = Buffer.from(readmeFile.content, 'base64').toString('utf-8');
|
let readmeContent = Buffer.from(readmeFile.content, 'base64').toString('utf-8');
|
||||||
@ -213,7 +221,7 @@ jobs:
|
|||||||
console.log('Preparing CSV content...');
|
console.log('Preparing CSV content...');
|
||||||
let csvContent = Buffer.from(csvFile.content, 'base64').toString('utf-8');
|
let csvContent = Buffer.from(csvFile.content, 'base64').toString('utf-8');
|
||||||
if (!csvContent.endsWith('\n')) csvContent += '\n';
|
if (!csvContent.endsWith('\n')) csvContent += '\n';
|
||||||
csvContent += `"${actName.replace(/"/g, '""')}","${cleanPrompt.replace(/"/g, '""')}"`;
|
csvContent += `"${actName.replace(/"/g, '""')}","${csvPrompt.replace(/"/g, '""')}"`;
|
||||||
|
|
||||||
// Create new branch
|
// Create new branch
|
||||||
const branchName = `prompt/${actName.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`;
|
const branchName = `prompt/${actName.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user