Implement CI to detect long path in pushed commit #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if the path of changed file is longer than 260 characters | |
# that windows filesystem allows | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
name: Detect long path among changed files | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
long-path: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v45 | |
- name: Detect long path | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
MAX_LENGTH: 120 # set max length to 120, considering the base path of app project that uses matrix-sdk | |
run: | | |
for file in ${ALL_CHANGED_FILES}; do | |
if [ ${#file} -gt $MAX_LENGTH ]; then | |
echo "File path is too long. Length: ${#file}" | |
exit 1 | |
fi | |
done | |
exit 0 |