mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-03 06:23:10 -05:00
dev: Allow locale sync path in auto merge (#6974)
This commit is contained in:
17
.github/workflows/auto-merge-l10n.yml
vendored
17
.github/workflows/auto-merge-l10n.yml
vendored
@@ -61,11 +61,20 @@ jobs:
|
|||||||
FILES=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json files --jq '.files[].path')
|
FILES=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json files --jq '.files[].path')
|
||||||
|
|
||||||
for file in $FILES; do
|
for file in $FILES; do
|
||||||
if [[ ! "$file" =~ ^frontend/lang/ ]] && [[ ! "$file" =~ ^mealie/repos/seed/resources/[^/]+/locales/ ]]; then
|
# Check if file matches any allowed path
|
||||||
echo "::error::Invalid file path: $file"
|
if [[ "$file" == "frontend/composables/use-locales/available-locales.ts" ]] || \
|
||||||
echo "Only files in frontend/lang/ or mealie/repos/seed/resources/*/locales/ are allowed"
|
[[ "$file" =~ ^frontend/lang/ ]] || \
|
||||||
exit 1
|
[[ "$file" =~ ^mealie/repos/seed/resources/[^/]+/locales/ ]]; then
|
||||||
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# File doesn't match allowed paths
|
||||||
|
echo "::error::Invalid file path: $file"
|
||||||
|
echo "Only the following paths are allowed:"
|
||||||
|
echo " - frontend/composables/use-locales/available-locales.ts"
|
||||||
|
echo " - frontend/lang/"
|
||||||
|
echo " - mealie/repos/seed/resources/*/locales/"
|
||||||
|
exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "All files are in allowed paths"
|
echo "All files are in allowed paths"
|
||||||
|
|||||||
Reference in New Issue
Block a user