Sample Header Ad - 728x90

How to check git porcelain on CI step?

0 votes
1 answer
28 views
I added this step to CI
-yaml
  check_if_there_is_change:
      - run: 
          name: Check that no git-tracked files were modified
          command: |
          FILES_MODIFIED="$(git status --porcelain)"
        if [[ -n "$FILES_MODIFIED" ]]; then
          echo "The following files were modified or added during the build process:"
          echo "$FILES_MODIFIED"
          echo "This will likely prevent successful publishing. Please run the build locally and include these changes in your pull request)"
          exit 1
        fi
But it fails
-plaintext
yaml.scanner.ScannerError: while scanning a simple key
  in ".circleci/main.yml", line 638, column 11
could not find expected ':'
  in ".circleci/main.yml", line 639, column 9
IntelliJ shows invalid child element in block mapping. How to change this? I want to know if files have been modified.
Asked by Milenko Markovic (17 rep)
Jan 24, 2025, 02:01 PM
Last activity: Feb 14, 2025, 05:26 AM