Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
18 changes: 13 additions & 5 deletions .github/ISSUE_TEMPLATE/submit-recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ body:

πŸͺ„ **What Happens After?**
- If accepted, we'll publish your recipe to the [Goose Recipes Cookbook](https://block.github.io/goose/recipes)
- You'll receive LLM credits as a thank-you!
- You'll receive **LLM API credits** as a thank-you!
Comment thread
EbonyLouis marked this conversation as resolved.
Outdated
- Your GitHub handle will be displayed and linked on the recipe card
- If you provide an email below, we’ll email you your credits when your recipe is approved and merged.

- type: textarea
id: recipe-json
Expand All @@ -35,12 +36,20 @@ body:
"category": "Entertainment",
"extensions": ["Developer"],
"activities": ["Tell a joke", "Daily humor"],
Comment thread
EbonyLouis marked this conversation as resolved.
Outdated
"recipeUrl": "goose://recipe?config=...",
"author": "your-github-handle"
}
validations:
required: true

- type: input
id: email
attributes:
label: Your Email (optional)
description: If your recipe is approved, we'll email your LLM API credits here.
placeholder: yourname@example.com
validations:
required: false

- type: markdown
attributes:
value: |
Expand All @@ -49,10 +58,9 @@ body:
- `"title"` is the display name of your recipe
- `"description"` should clearly explain what the recipe does
- `"instructions"` are the specific instructions for the Goose agent
- `"prompt"` is the initial prompt that starts the recipe when launched
- `"prompt"` *(optional)* is the initial prompt that starts the recipe when launched
- `"action"` describes the core purpose of the recipe (e.g., `Generate Docs`)
- `"category"` is the type of user this recipe is for (e.g., `Developer`, `Entertainment`)
- `"extensions"` are the Goose tools this recipe uses
- `"activities"` are the main steps or capabilities of your recipe
- `"recipeUrl"` is from Goose Desktop/CLI
- `"author"` is your GitHub handle β€” we'll link to your profile in the Cookbook
- `"author"` is your GitHub handle β€” we'll link to your profile in the Cookbook
Comment thread
EbonyLouis marked this conversation as resolved.
Outdated
100 changes: 100 additions & 0 deletions .github/workflows/create-recipe-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Handle Recipe Submissions

on:
issues:
types: [opened]
labels:
- recipe submission

permissions:
contents: write
issues: write
pull-requests: write

jobs:
create-recipe-pr:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Parse recipe from issue
id: parse
run: |
ISSUE_BODY=$(jq -r .issue.body "$GITHUB_EVENT_PATH")

# Extract the JSON block from the issue body
RECIPE_JSON=$(echo "$ISSUE_BODY" | awk '/```/,/```/' | sed '1d;$d')

echo "$RECIPE_JSON" > recipe.json
Comment thread
angiejones marked this conversation as resolved.
Outdated

# Extract title to use as a slug
TITLE=$(jq -r .title recipe.json | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9' '-')
BRANCH_NAME="add-recipe-${TITLE}"

echo "branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
echo "recipe_json=${RECIPE_JSON}" >> $GITHUB_OUTPUT

- name: Validate recipe fields
Comment thread
EbonyLouis marked this conversation as resolved.
Outdated
run: |
REQUIRED_FIELDS=(id title description instructions action category extensions activities author)
for field in "${REQUIRED_FIELDS[@]}"; do
VALUE=$(jq -r ".${field}" recipe.json)
if [[ "$VALUE" == "null" || "$VALUE" == "" ]]; then
echo "❌ Missing required field: $field"
exit 1
fi
done
echo "βœ… All required fields present."

- name: Generate recipeUrl and update JSON
run: |
BASE64_ENCODED=$(jq -c . recipe.json | base64 | tr -d '\n')
RECIPE_URL="goose://recipe?config=${BASE64_ENCODED}"
jq --arg url "$RECIPE_URL" '. + {recipeUrl: $url}' recipe.json > updated-recipe.json

- name: Create branch and add file
run: |
BRANCH_NAME=${{ steps.parse.outputs.branch_name }}
git checkout -b "$BRANCH_NAME"

DEST_DIR="documentation/src/pages/recipes/data/recipes"
mkdir -p "$DEST_DIR"

ID=$(jq -r .id updated-recipe.json)
cp updated-recipe.json "$DEST_DIR/${ID}.json"

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add "$DEST_DIR/${ID}.json"
git commit -m "Add recipe: ${ID}"
git push origin "$BRANCH_NAME"

Comment thread Fixed
- name: Create pull request
id: cpr
uses: peter-evans/create-pull-request@v5
Comment thread Fixed
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.parse.outputs.branch_name }}
title: "Add recipe: ${{ fromJson(steps.parse.outputs.recipe_json).title }}"
body: "This PR adds a new Goose recipe submitted via issue #${{ github.event.issue.number }}."
reviewers: |
EbonyLouis
angiejones
blackgirlbytes

- name: Comment and close issue
run: |
ISSUE_NUMBER=${{ github.event.issue.number }}
PR_URL=${{ steps.cpr.outputs.pull-request-url }}

gh issue comment "$ISSUE_NUMBER" --body "πŸŽ‰ Thanks for submitting your recipe! We've created a [PR]($PR_URL) to add it to the Cookbook."
gh issue close "$ISSUE_NUMBER"
Comment thread Fixed
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading