name: CI

on: [pull_request_target, pull_request]

jobs:
  changed_files:
    runs-on: ubuntu-latest
    name: Test changed-files
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Get changed files
        id: source 
        uses: tj-actions/changed-files@v40

      - name: Remove foo from changed files
        id: step
        uses: mad9000/actions-find-and-replace-string@3
        with:
          source: ${{ steps.source.outputs.all_changed_files }}
          find: 'foo'
          replace: ''

      - name: List all changed files
        id: sink
        run: |
          for file in ${{ steps.step.outputs.value }}; do
            echo "$file was changed"
          done

      - name: List all changed files
        id: no-flow
        run: |
          for file in ${{ steps.source.outputs.all_changed_files_count }}; do
            echo "$file was changed"
          done

