Skip to content

Commit

Permalink
Tweak CI
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Jun 6, 2024
1 parent 86c56d7 commit 0e54a98
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/fetch-wxr-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ jobs:
- name: Fetch base branch
run: |
git fetch origin trunk
# TODO: Go by file paths listed under importWxr in blueprint.json
- name: Find WXR and XML files added in PR
id: find_files
run: |
FILES=$(git diff --name-only origin/trunk | grep -E '\.(wxr|xml)$')
if [ -z "$FILES" ]; then
echo "No newly added WXR or XML files to check."
exit 0
fi
echo "::set-output name=files::$FILES"
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -40,10 +30,16 @@ jobs:
run: |
curl https://github.com/adamziel/wxr-normalize/raw/trunk/preprocess-wxr.phar > /tmp/preprocess-wxr.phar
# TODO: Go by file paths listed under importWxr in blueprint.json
- name: Validate file contents
id: validate_files
run: |
for FILE in ${{ steps.find_files.outputs.files }}; do
FILES=$(git diff --name-only origin/trunk | grep -E '\.(wxr|xml)$')
if [ -z "$FILES" ]; then
echo "No newly added WXR or XML files to check."
exit 1
fi
for FILE in $FILES; do
CONTENT=$(cat $FILE)
if [[ "$CONTENT" != *"<content:encoded>"* ]]; then
echo "File $FILE does not contain '<content:encoded>', skipping."
Expand Down

0 comments on commit 0e54a98

Please sign in to comment.