jn: push

jobs:
  job0:
    runs-on: ubuntu-latest
    outputs:
      job_output: foo
    steps:
      - run: echo "foo"

  job1:
    runs-on: ubuntu-latest

    outputs:
      job_output: ${{ steps.step.outputs.value }}

    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: ''

  job2:
    runs-on: ubuntu-latest

    if: ${{ always() }}

    needs:
      - job0

    steps:
      - id: sink
        # Should not be reported since job1 is not needed
        run: echo ${{needs.job1.outputs.job_output}}
