tj-actions / changed-files

:octocat: Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.
MIT License
1.78k stars 191 forks source link

[BUG] Modified files treated as `Non Matching modified files` #450

Closed miszo closed 2 years ago

miszo commented 2 years ago

Is there an existing issue for this?

Does this issue exist in the latest version?

Describe the bug?

Files that are modified in the pull request are being somehow skipped. It is funny because I do it for 3 packages in monorepo and dashboard is the only one that acts this way.

To Reproduce

  1. I have two next.js apps homepage and dashboard and ui package in turborepo.
  2. I have the following quality-gate job.
jobs:
  eslint:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - app_scope: ui
            package_path: ./packages/ui
            eslint_flags: '**/*.{ts,tsx}'
            files: |
              packages/ui/**
              packages/jest-config/**
              packages/linters-config/**
              packages/tsconfig/**
              packages/types/**
              .github/actions/checkout-remote-actions/action.yml
              .github/workflows/quality-gate.yml
          - app_scope: homepage
            package_path: ./apps/homepage
            eslint_flags: '--quiet **/*.{ts,tsx}'
            files: |
              apps/homepage/**
              packages/app-config/**
              .github/actions/checkout-remote-actions/action.yml
              .github/workflows/quality-gate.yml
          - app_scope: dashboard
            package_path: ./apps/dashboard
            eslint_flags: '**/*.{ts,tsx}'
            files: |
              apps/dashboard/**/*
              packages/app-config/**/*
              packages/jest-config/**/*
              packages/linters-config/**/*
              packages/tsconfig/**/*
              packages/types/**/*
              packages/ui/**/*
              packages/webpack-loaders/**/*
              .github/actions/checkout-remote-actions/action.yml
              .github/workflows/quality-gate.yml
    steps:
      - uses: actions/checkout@v3

      - name: Get specific changed files
        id: changed_files
        uses: tj-actions/changed-files@v18.4
        with:
          files: ${{ matrix.files }}

      - name: Show output json
        run: |
          echo "${{ toJSON(steps.changed_files.outputs) }}"

      - name: No file was modified
        if: steps.changed_files.outputs.any_modified == 'false'
        run: |
          echo "None of the files listed above was modified."

      - name: Files was modified
        if: steps.changed_files.outputs.any_modified == 'true'
        run: |
          echo "Rest of the job steps go here."
  1. I've deleted some actions definitions and modified files in ui, homepage and dashboard to test it jobs are triggering.
  2. ui and homepage works as expected - dashboard have issues.

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

If files from the provided files list are modified, then they should be recognized as modified files.

Relevant log output

### dashboard eslint starts here ###

Run tj-actions/changed-files@v18.4
  with:
    files: apps/dashboard/**
  packages/app-config/**
  packages/jest-config/**
  packages/linters-config/**
  packages/tsconfig/**
  packages/types/**
  packages/ui/**
  packages/webpack-loaders/**
  .github/actions/checkout-remote-actions/action.yml
  .github/workflows/quality-gate.yml

    token: ***
    separator:  
    files_separator: 

    files_ignore_separator: 

    sha: 4766508dda1eb2aa0024a5993125cd28ad15976d
    since_last_remote_commit: false
    use_fork_point: false
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
Run # "Set base sha..."
Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
Run tj-actions/glob@v7.10
  with:
    files: apps/dashboard/**
  packages/app-config/**
  packages/jest-config/**
  packages/linters-config/**
  packages/tsconfig/**
  packages/types/**
  packages/ui/**
  packages/webpack-loaders/**
  .github/actions/checkout-remote-actions/action.yml
  .github/workflows/quality-gate.yml

    files-separator: 

    excluded-files-separator: 

    base-sha: 4edc0786a63e176c429514293013c787b5d68018
    sha: 4766508dda1eb2aa0024a5993125cd28ad15976d
    include-deleted-files: true
    separator: |
    files-from-source-file-separator: 

    excluded-files-from-source-file-separator: 

    follow-symbolic-links: true
    strip-top-level-dir: true
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
/usr/bin/git rev-parse --show-toplevel
/home/runner/work/#REDACTED#
/usr/bin/git diff --diff-filter=D --name-only 4edc0786a63e176c429514293013c787b5d68018 4766508dda1eb2aa0024a5993125cd28ad15976d
.github/workflows/dashboard-quality-gate.yml
.github/workflows/homepage-quality-gate.yml
.github/workflows/storybook-quality-gate.yml
.github/workflows/ui-quality-gate.yml

Successfully created paths-output-file: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt
Run bash $GITHUB_ACTION_PATH/entrypoint.sh
  bash $GITHUB_ACTION_PATH/entrypoint.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
    GITHUB_ACTION_PATH: /home/runner/work/_actions/tj-actions/changed-files/v18.4
    INPUT_FILES_PATTERN_FILE: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt
    INPUT_SEPARATOR:  
    INPUT_PATH: 
    INPUT_PREVIOUS_SHA: 4edc0786a63e176c429514293013c787b5d68018
    INPUT_CURRENT_SHA: 4766508dda1eb2aa0024a5993125cd28ad15976d
    INPUT_TARGET_BRANCH: develop
    INPUT_CURRENT_BRANCH: chore/merge-quality-gate
changed-files
  Resolving repository path...
  Retrieving changes between 4edc0786a63e176c429514293013c787b5d68018 (develop) → 4766508dda1eb2aa0024a5993125cd28ad15976d (chore/merge-quality-gate)
  Getting diff...
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  Non Matching changed files: .github/workflows/quality-gate.yml apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts apps/homepage/src/components/organisms/RfpModal/OfficeForm.tsx packages/ui/components/NavigationBar/NavigationBar.tsx
  Non Matching modified files: .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-quality-gate.yml .github/workflows/quality-gate.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts apps/homepage/src/components/organisms/RfpModal/OfficeForm.tsx packages/ui/components/NavigationBar/NavigationBar.tsx
  Non Matching deleted files: .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-quality-gate.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml
  Added files: 
  Copied files: 
  Deleted files: 
  Modified files: 
  Renamed files: 
  Type Changed files: 
  Unmerged files: 
  Unknown files: 
  All changed and modified files: 
  All changed files: 
  All modified files: 

### dashboard eslint ends here ###

### homepage eslint starts here ###

Run tj-actions/changed-files@v18.4
  with:
    files: apps/homepage/**
  packages/app-config/**
  .github/actions/checkout-remote-actions/action.yml
  .github/workflows/quality-gate.yml

    token: ***
    separator:  
    files_separator: 

    files_ignore_separator: 

    sha: 4766508dda1eb2aa0024a5993125cd28ad15976d
    since_last_remote_commit: false
    use_fork_point: false
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
Run # "Set base sha..."
Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
Run tj-actions/glob@v7.10
  with:
    files: apps/homepage/**
  packages/app-config/**
  .github/actions/checkout-remote-actions/action.yml
  .github/workflows/quality-gate.yml

    files-separator: 

    excluded-files-separator: 

    base-sha: 4edc0786a63e176c429514293013c787b5d68018
    sha: 4766508dda1eb2aa0024a5993125cd28ad15976d
    include-deleted-files: true
    separator: |
    files-from-source-file-separator: 

    excluded-files-from-source-file-separator: 

    follow-symbolic-links: true
    strip-top-level-dir: true
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
/usr/bin/git rev-parse --show-toplevel
/home/runner/work/#REDACTED#
/usr/bin/git diff --diff-filter=D --name-only 4edc0786a63e176c429514293013c787b5d68018 4766508dda1eb2aa0024a5993125cd28ad15976d
.github/workflows/dashboard-quality-gate.yml
.github/workflows/homepage-quality-gate.yml
.github/workflows/storybook-quality-gate.yml
.github/workflows/ui-quality-gate.yml

Successfully created paths-output-file: /tmp/abbdb673-5b37-4bf3-86c6-a414a0df883a.txt
Run bash $GITHUB_ACTION_PATH/entrypoint.sh
changed-files
  Resolving repository path...
  Retrieving changes between 4edc0786a63e176c429514293013c787b5d68018 (develop) → 4766508dda1eb2aa0024a5993125cd28ad15976d (chore/merge-quality-gate)
  Getting diff...
  Matching changed files: .github/workflows/quality-gate.yml|apps/homepage/src/components/organisms/RfpModal/OfficeForm.tsx
  Non Matching changed files: apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts packages/ui/components/NavigationBar/NavigationBar.tsx
  Matching modified files: .github/workflows/quality-gate.yml|apps/homepage/src/components/organisms/RfpModal/OfficeForm.tsx
  Non Matching modified files: .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-quality-gate.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts packages/ui/components/NavigationBar/NavigationBar.tsx

### homepage eslint ends here ###

Anything else?

No response

Code of Conduct

github-actions[bot] commented 2 years ago

Thanks for reporting this issue, don't forget to star this project to help us reach a wider audience.

miszo commented 2 years ago

I wonder why I'm getting the message like this in dashboard step

  Resolving repository path...
  Retrieving changes between 4edc0786a63e176c429514293013c787b5d68018 (develop) → 4766508dda1eb2aa0024a5993125cd28ad15976d (chore/merge-quality-gate)
  Getting diff...
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
  grep: /tmp/527d24c3-451b-4168-9d1f-bce23c6fffa2.txt:1: Unmatched [, [^, [:, [., or [=
jackton1 commented 2 years ago

@miszo Can you try changing the glob pattern

FROM

          - app_scope: dashboard
            package_path: ./apps/dashboard
            eslint_flags: '**/*.{ts,tsx}'
            files: |
              apps/dashboard/**/*
              packages/app-config/**/*
              packages/jest-config/**/*
              packages/linters-config/**/*
              packages/tsconfig/**/*
              packages/types/**/*
              packages/ui/**/*
              packages/webpack-loaders/**/*
              .github/actions/checkout-remote-actions/action.yml
              .github/workflows/quality-gate.yml

TO

          - app_scope: dashboard
            package_path: ./apps/dashboard
            eslint_flags: '**/*.{ts,tsx}'
            files: |
              apps/dashboard/**
              packages/app-config/**
              packages/jest-config/**
              packages/linters-config/**
              packages/tsconfig/**
              packages/types/**
              packages/ui/**
              packages/webpack-loaders/**
              .github/actions/checkout-remote-actions/action.yml
              .github/workflows/quality-gate.yml
miszo commented 2 years ago

@jackton1, actually I've tried that also. With the same result.

jackton1 commented 2 years ago

@miszo Can you verify the output of the tempfile

Run:

find /tmp -type f -name "*.txt" -exec head -n5 {} \;

After executing tj-actions/changed-files action

miszo commented 2 years ago

@jackton1, should I search for something specific in the tempfile? You know, it is a private repo with client-facing platform, and I'm not comfortable to share this publicly. Maybe I can send you this file through some private channel? E-mail perhaps?

miszo commented 2 years ago

@jackton1, here's the private repo with the file output. I've sent you an invitation.

jackton1 commented 2 years ago

@miszo Thanks the output looks correct, I’ll spend sometime debugging this.

jackton1 commented 2 years ago

Found the issue I’ll create a fix later today

miszo commented 2 years ago

@jackton1, I've just tried to use action from branch fix/bug-with-pattern-matching and I'm getting the same results as before 😿

miszo commented 2 years ago

Here's log for the dashboard app:

Run tj-actions/changed-files@fix/bug-with-pattern-matching
  with:
    files: apps/dashboard/**
  packages/app-config/**
  packages/jest-config/**
  packages/linters-config/**
  packages/tsconfig/**
  packages/types/**
  packages/ui/**
  packages/webpack-loaders/**
  .github/actions/checkout-remote-actions/action.yml
  .github/workflows/quality-gate.yml

    token: ***
    separator:  
    files_separator: 

    files_ignore_separator: 

    sha: 4d477[2](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:2)d5e7407d6829e[3](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:3)68[4](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:4)b12d0c7b1811e43f[5](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:5)
    since_last_remote_commit: false
    use_fork_point: false
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
Run # "Set base sha..."
Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
Run tj-actions/glob@v7.13
  with:
    files: apps/dashboard/**
  packages/app-config/**
  packages/jest-config/**
  packages/linters-config/**
  packages/tsconfig/**
  packages/types/**
  packages/ui/**
  packages/webpack-loaders/**
  .github/actions/checkout-remote-actions/action.yml
  .github/workflows/quality-gate.yml

    files-separator: 

    escape-paths: true
    excluded-files-separator: 

    base-sha: be7c[6](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:6)fbeb28d8f9439582d1936aa2a3f269d[7](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:7)59a
    sha: 4d4772d5e7407d6[8](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:8)2[9](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:9)e3684b12d0c7b18[11](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:11)e43f5
    include-deleted-files: true
    separator: |
    files-from-source-file-separator: 

    excluded-files-from-source-file-separator: 

    follow-symbolic-links: true
    strip-top-level-dir: true
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
/usr/bin/git rev-parse --show-toplevel
/home/runner/work/**REDACTED**
/usr/bin/git diff --diff-filter=D --name-only be7c6fbeb28d8f9439582d1936aa2a3f269d759a 4d4772d5e7407d6829e3684b[12](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:12)d0c7b1811e43f5
.github/workflows/dashboard-quality-gate.yml
.github/workflows/homepage-quality-gate.yml
.github/workflows/storybook-quality-gate.yml
.github/workflows/ui-quality-gate.yml

Successfully created paths-output-file: /tmp/d3e95ebe-37fd-43ac-b01c-ca270a[13](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:13)069d.txt
Run bash $GITHUB_ACTION_PATH/entrypoint.sh
  bash $GITHUB_ACTION_PATH/entrypoint.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
    GITHUB_ACTION_PATH: /home/runner/work/_actions/tj-actions/changed-files/fix/bug-with-pattern-matching
    INPUT_FILES_PATTERN_FILE: /tmp/d3e95ebe-37fd-43ac-b01c-ca270a13069d.txt
    INPUT_SEPARATOR:  
    INPUT_PATH: 
    INPUT_PREVIOUS_SHA: be7c6fbeb28d8f9439582d1936aa2a3f269d759a
    INPUT_CURRENT_SHA: 4d4772d5e7407d6829e3684b12d0c7b[18](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:18)11e43f5
    INPUT_TARGET_BRANCH: develop
    INPUT_CURRENT_BRANCH: chore/merge-quality-gate
changed-files
  Resolving repository path...
  Retrieving changes between be7c6fbeb28d8f9439582d[19](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:19)36aa2a3f[26](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:26)9d759a (develop) → 4d4772d5e7407d6829e3684b12d0c7b[181](https://github.com/**REDACTED**/runs/5738809273?check_suite_focus=true#step:3:181)1e43f5 (chore/merge-quality-gate)
  Getting diff...
  Non Matching changed files: .github/workflows/quality-gate.yml apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts apps/homepage/src/components/organisms/RfpModal/OfficeForm.tsx packages/ui/components/NavigationBar/NavigationBar.tsx
  Non Matching modified files: .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-quality-gate.yml .github/workflows/quality-gate.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts apps/homepage/src/components/organisms/RfpModal/OfficeForm.tsx packages/ui/components/NavigationBar/NavigationBar.tsx
  Non Matching deleted files: .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-quality-gate.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml
  Added files: 
  Copied files: 
  Deleted files: 
  Modified files: 
  Renamed files: 
  Type Changed files: 
  Unmerged files: 
  Unknown files: 
  All changed and modified files: 
  All changed files: 
  All modified files:
miszo commented 2 years ago

@jackton1, there's no log about grep error, but the outcome is the same.

miszo commented 2 years ago

@jackton1, looks like last change resolved the issue for dashboard.

Run tj-actions/changed-files@fix/bug-with-pattern-matching
  with:
    files: apps/dashboard/**
  packages/app-config/**
  packages/jest-config/**
  packages/linters-config/**
  packages/tsconfig/**
  packages/types/**
  packages/ui/**
  packages/webpack-loaders/**
  .github/actions/checkout-remote-actions/action.yml
  .github/workflows/quality-gate.yml

    token: ***
    separator:  
    files_separator: 

    files_ignore_separator: 

    sha: 3ccf5234dc28c9ce4c1b695758a0456acd450489
    since_last_remote_commit: false
    use_fork_point: false
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
Run # "Set base sha..."
Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
Run tj-actions/glob@v7.14
  with:
    files: apps/dashboard/**
  packages/app-config/**
  packages/jest-config/**
  packages/linters-config/**
  packages/tsconfig/**
  packages/types/**
  packages/ui/**
  packages/webpack-loaders/**
  .github/actions/checkout-remote-actions/action.yml
  .github/workflows/quality-gate.yml

    files-separator: 

    escape-paths: true
    excluded-files-separator: 

    base-sha: be7c6fbeb28d8f9439582d1936aa2a3f269d759a
    sha: 3ccf5234dc28c9ce4c1b695758a0456acd450489
    include-deleted-files: true
    separator: |
    files-from-source-file-separator: 

    excluded-files-from-source-file-separator: 

    follow-symbolic-links: true
    strip-top-level-dir: true
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
/usr/bin/git rev-parse --show-toplevel
/home/runner/work/**REDACTED**
/usr/bin/git diff --diff-filter=D --name-only be7c6fbeb28d8f9439582d1936aa2a3f269d759a 3ccf5234dc28c9ce4c1b695758a0456acd450489
.github/workflows/dashboard-quality-gate.yml
.github/workflows/homepage-quality-gate.yml
.github/workflows/storybook-quality-gate.yml
.github/workflows/ui-quality-gate.yml
Successfully created paths-output-file: /tmp/dca9856d-2c5c-4432-a6a3-46b49fef9c00.txt
Run bash $GITHUB_ACTION_PATH/entrypoint.sh
changed-files
  Resolving repository path...
  Retrieving changes between be7c6fbeb28d8f9439582d1936aa2a3f269d759a (develop) → 3ccf5234dc28c9ce4c1b695758a0456acd450489 (chore/merge-quality-gate)
  Getting diff...
  Matching changed files: apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx|apps/dashboard/src/common/transforms/parseDate/parseDate.ts|packages/ui/components/NavigationBar/NavigationBar.tsx
  Non Matching changed files: .github/workflows/quality-gate.yml apps/homepage/src/components/organisms/RfpModal/OfficeForm.tsx
  Matching modified files: apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx|apps/dashboard/src/common/transforms/parseDate/parseDate.ts|packages/ui/components/NavigationBar/NavigationBar.tsx
  Non Matching modified files: .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-quality-gate.yml .github/workflows/quality-gate.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml apps/homepage/src/components/organisms/RfpModal/OfficeForm.tsx
  Non Matching deleted files: .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-quality-gate.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml
  Added files: 
  Copied files: 
  Deleted files: 
  Modified files: apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts packages/ui/components/NavigationBar/NavigationBar.tsx
  Renamed files: 
  Type Changed files: 
  Unmerged files: 
  Unknown files: 
  All changed and modified files: apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts packages/ui/components/NavigationBar/NavigationBar.tsx
  All changed files: apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts packages/ui/components/NavigationBar/NavigationBar.tsx
  All modified files: apps/dashboard/src/common/layouts/DashboardLayout/DashboardLayout.stories.tsx apps/dashboard/src/common/transforms/parseDate/parseDate.ts packages/ui/components/NavigationBar/NavigationBar.tsx

Let me just try last time with all packages and apps.

jackton1 commented 2 years ago

@miszo Oh okay, it should be resolved for all apps now using the latest release.

miszo commented 2 years ago

@jackton1, it works for most of the cases, but for some reason it doesn't work when I change only GitHub workflow definition files.

Here's the log:

Run tj-actions/changed-files@v18.5
  with:
    files: apps/homepage/**
  packages/app-config/**
  **/actions/checkout-remote-actions/action.yml
  **/workflows/quality-gate.yml

    token: ***
    separator:  
    files_separator: 

    files_ignore_separator: 

    sha: ccf71c5b1ac4a814506fc[2](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:2)e0181ae52fc6ecfcc1
    since_last_remote_commit: false
    use_fork_point: false
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
Run # "Set base sha..."
Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
Run tj-actions/glob@v7.14
  with:
    files: apps/homepage/**
  packages/app-config/**
  **/actions/checkout-remote-actions/action.yml
  **/workflows/quality-gate.yml

    files-separator: 

    escape-paths: true
    excluded-files-separator: 

    base-sha: be7c6fbeb28d8f94[3](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:3)9582d1936aa2a3f269d759a
    sha: ccf71c5b1ac[4](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:4)a814[5](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:5)0[6](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:6)fc2e0181ae52fc6ecfcc1
    include-deleted-files: true
    separator: |
    files-from-source-file-separator: 

    excluded-files-from-source-file-separator: 

    follow-symbolic-links: true
    strip-top-level-dir: true
  env:
    REVIEWDOG_LEVEL: error
    REVIEWDOG_FILTER_MODE: file
    REVIEWDOG_REPORTER: github-pr-review
/usr/bin/git rev-parse --show-toplevel
/home/runner/work/**REDACTED**
/usr/bin/git diff --diff-filter=D --name-only be[7](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:7)c6fbeb2[8](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:8)d8f[9](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:9)439582d1936aa2a3f269d759a ccf71c5b1ac4a8[14](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:14)506fc2e0181ae52fc6ecfcc1
.github/workflows/dashboard-quality-gate.yml
.github/workflows/homepage-quality-gate.yml
.github/workflows/storybook-quality-gate.yml
.github/workflows/ui-quality-gate.yml

Successfully created paths-output-file: /tmp/3fe3ce[16](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:16)-71bf-4ac3-a20f-22a33ba05d40.txt
Run bash $GITHUB_ACTION_PATH/entrypoint.sh
changed-files
  Resolving repository path...
  Retrieving changes between be7c6fbeb28d8f9439582d1936aa2a3f269d759a (develop) → ccf71c5b1ac4a814506fc2e0[18](https://github.com/**REDACTED**/runs/5740322474?check_suite_focus=true#step:3:18)1ae52fc6ecfcc1 (chore/merge-quality-gate)
  Getting diff...
  Non Matching changed files: .github/workflows/conventional-pull-requests.yml .github/workflows/dashboard-build.yml .github/workflows/homepage-build.yml .github/workflows/label.yml .github/workflows/pr-meme.yml .github/workflows/quality-gate.yml .github/workflows/storybook-build.yml
  Non Matching modified files: .github/workflows/conventional-pull-requests.yml .github/workflows/dashboard-build.yml .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-build.yml .github/workflows/homepage-quality-gate.yml .github/workflows/label.yml .github/workflows/pr-meme.yml .github/workflows/quality-gate.yml .github/workflows/storybook-build.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml
  Non Matching deleted files: .github/workflows/dashboard-quality-gate.yml .github/workflows/homepage-quality-gate.yml .github/workflows/storybook-quality-gate.yml .github/workflows/ui-quality-gate.yml
  Added files: 
  Copied files: 
  Deleted files: 
  Modified files: 
  Renamed files: 
  Type Changed files: 
  Unmerged files: 
  Unknown files: 
  All changed and modified files: 
  All changed files: 
  All modified files:

And I've tried with both:

            files: |
              apps/homepage/**
              packages/app-config/**
              **/actions/checkout-remote-actions/action.yml
              **/workflows/quality-gate.yml

and

            files: |
              apps/homepage/**
              packages/app-config/**
              .github/actions/checkout-remote-actions/action.yml
              .github/workflows/quality-gate.yml
jackton1 commented 2 years ago

@miszo The pattern looks off .github/workflows/quality-gate.yml would need to be .github/workflows/*-quality-gate.yml to match .github/workflows/homepage-quality-gate.yml

miszo commented 2 years ago

@jackton1, but I've modified .github/workflows/quality-gate.yml file and deleted .github/workflows/homepage-quality-gate.yml. So, I assume that it should mark the file .github/workflows/quality-gate.yml as modified.

miszo commented 2 years ago

Generally, I've merged .github/workflows/dashboard-quality-gate.yml, .github/workflows/homepage-quality-gate.yml, .github/workflows/storybook-quality-gate.yml, .github/workflows/ui-quality-gate.yml into one .github/workflows/quality-gate.yml. So in this case files .github/workflows/dashboard-quality-gate.yml, .github/workflows/homepage-quality-gate.yml, .github/workflows/storybook-quality-gate.yml, .github/workflows/ui-quality-gate.yml are fitting perfectly in Non Matching deleted files category, but I think that .github/workflows/quality-gate.yml should be in All modified files

jackton1 commented 2 years ago

@miszo Strange this works as expected from the test: https://github.com/tj-actions/changed-files/runs/5740545078?check_suite_focus=true#step:17:103

C9C3D012-5225-43DF-A0C5-9E3C5993E004

I’ll recommend verifying that the diff actually contains changes related to the workflows files listed.

You might optionally need to enable since_last_remote_commit

miszo commented 2 years ago

Hm... that's weird. I'll try to reproduce it in public repository and then send you the link.

miszo commented 2 years ago

Hi @jackton1, I've reproduced the situation in public repository – you can verify the outcome here https://github.com/miszo/tj-actions_changed-files/actions/workflows/quality-gate.yml

I've added you as a contributor to the repo, so feel free to create another branch and play with the patterns.

miszo commented 2 years ago

@jackton1, It works a charm! Thanks for the fix!

Have a great day!

jackton1 commented 2 years ago

No worries. Thanks for creating the public/private repositories they were super helpful in resolving this.