Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions .github/workflows/recipe-security-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:
set -e
echo "🔍 Checking if recipe files were modified in this push..."

# Get the list of changed files in this specific push
# Get the list of changed files in this specific push (added/modified only, not deleted)
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.action }}" = "synchronize" ]; then
# For synchronize events, check files changed since the previous commit
echo "📝 Synchronize event - checking files changed since previous commit"
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }})
CHANGED_FILES=$(git diff --name-only --diff-filter=AM ${{ github.event.before }}..${{ github.event.after }})
else
# For opened/reopened, check all files in the PR
echo "📝 PR opened/reopened - checking all files in PR"
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}..HEAD)
CHANGED_FILES=$(git diff --name-only --diff-filter=AM origin/${{ github.base_ref }}..HEAD)
fi

echo "Changed files in this push:"
Expand All @@ -71,15 +71,15 @@ jobs:
set -e
echo "Looking for recipe files in PR (new or modified)..."

# Get the list of changed/new files in this PR
# Get the list of changed/new files in this PR (added/modified only, not deleted)
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.action }}" = "synchronize" ]; then
# For synchronize events, check files changed since the previous commit
echo "📝 Synchronize event - checking files changed/added since previous commit"
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }})
CHANGED_FILES=$(git diff --name-only --diff-filter=AM ${{ github.event.before }}..${{ github.event.after }})
else
# For opened/reopened, check all files in the PR (new and modified)
echo "📝 PR opened/reopened - checking all new/modified files in PR"
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}..HEAD)
CHANGED_FILES=$(git diff --name-only --diff-filter=AM origin/${{ github.base_ref }}..HEAD)
fi

# Filter for recipe files only that were changed or added
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/send-api-key.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
PR_NUMBER: ${{ github.event.pull_request.number }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/validate-recipe-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ jobs:
set -e
echo "🔍 Checking if recipe files were modified in this push..."

# Get the list of changed files in this specific push
# Get the list of changed files in this specific push (added/modified only, not deleted)
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.action }}" = "synchronize" ]; then
# For synchronize events, check files changed since the previous commit
echo "📝 Synchronize event - checking files changed since previous commit"
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }})
CHANGED_FILES=$(git diff --name-only --diff-filter=AM ${{ github.event.before }}..${{ github.event.after }})
else
# For opened/reopened, check all files in the PR
echo "📝 PR opened/reopened - checking all files in PR"
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}..HEAD)
CHANGED_FILES=$(git diff --name-only --diff-filter=AM origin/${{ github.base_ref }}..HEAD)
fi

echo "Changed files in this push:"
Expand All @@ -80,15 +80,15 @@ jobs:
set -e
echo "Looking for recipe files in PR (new or modified)..."

# Get the list of changed/new files in this PR
# Get the list of changed/new files in this PR (added/modified only, not deleted)
if [ "${{ github.event_name }}" = "pull_request" ] && [ "${{ github.event.action }}" = "synchronize" ]; then
# For synchronize events, check files changed since the previous commit
echo "📝 Synchronize event - checking files changed/added since previous commit"
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }}..${{ github.event.after }})
CHANGED_FILES=$(git diff --name-only --diff-filter=AM ${{ github.event.before }}..${{ github.event.after }})
else
# For opened/reopened, check all files in the PR (new and modified)
echo "📝 PR opened/reopened - checking all new/modified files in PR"
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}..HEAD)
CHANGED_FILES=$(git diff --name-only --diff-filter=AM origin/${{ github.base_ref }}..HEAD)
fi

# Filter for recipe files only that were changed or added
Expand Down
Loading