updating our 3 workflows to only operate if the PR is adding/editing a recipe (#4441)

This commit is contained in:
w. ian douglas
2025-08-29 16:38:35 -06:00
committed by GitHub
parent da731704f1
commit beb7a70a43
3 changed files with 38 additions and 12 deletions
+26
View File
@@ -15,13 +15,39 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if recipe files were added or modified in merged PR
id: recipe_changes
run: |
set -e
echo "🔍 Checking if recipe files were added or modified in merged PR..."
# Get the list of files that were added or modified in the merged PR (not deleted)
CHANGED_FILES=$(git diff --name-only --diff-filter=AM ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }})
echo "Files added/modified in merged PR:"
echo "$CHANGED_FILES"
echo ""
# Check if any recipe files were added or modified
if echo "$CHANGED_FILES" | grep -q "^documentation/src/pages/recipes/data/recipes/"; then
echo "recipe_files_changed=true" >> "$GITHUB_OUTPUT"
echo "✅ Recipe files were added/modified in merged PR - proceeding with API key sending"
else
echo "recipe_files_changed=false" >> "$GITHUB_OUTPUT"
echo "️ No recipe files were added/modified in merged PR - skipping API key sending"
fi
- name: Set up Python
if: steps.recipe_changes.outputs.recipe_files_changed == 'true'
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies and run email script
if: steps.recipe_changes.outputs.recipe_files_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_SHA: ${{ github.sha }}