Skip to content

Cryptonaito

Cryptonaito #5

name: Check file changes
on:
workflow_dispatch:
workflow_call:
jobs:
check-file-changes:
runs-on: ubuntu-latest
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
IFS=', ' read -r -a changed_files_array <<< "$ALL_CHANGED_FILES"

Check failure on line 20 in .github/workflows/check-file-changes.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/check-file-changes.yml

Invalid workflow file

You have an error in your yaml syntax on line 20
echo "All changed files: $changed_files_array"
echo "All changed files length: ${#changed_files_array[@]}"
if [ ${#changed_files_array[@]} -ne 1 ]; then
echo "Error: Array should contain exactly one file name."
exit 1
fi
file_name="${changed_files_array[0]}"
if [[ ! "$file_name" =~ ^app_chains.*\.json$ ]]; then
echo "Error: Only a '.json' file must be added in the app_chains folder."
exit 1
fi
IFS=', ' read -r -a changed_files_array <<< "$ALL_CHANGED_FILES"
echo "All changed files: $changed_files_array"
echo "All changed files length: ${#changed_files_array[@]}"
if [ ${#changed_files_array[@]} -ne 1 ]; then
echo "Error: Array should contain exactly one file name."
exit 1
fi
file_name="${changed_files_array[0]}"
expected_file_name="42a2e2f1-d685-4cf3-8a4d-c0560026a394.json"
if [ "$file_name" != "$expected_file_name" ]; then
echo "Error: The file name must be '$expected_file_name'."
exit 1
fi