Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Glob pattern doesn't work for markdown files #492

Closed
3 tasks done
jack-fireworkhq opened this issue May 16, 2022 · 2 comments
Closed
3 tasks done

[BUG] Glob pattern doesn't work for markdown files #492

jack-fireworkhq opened this issue May 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@jack-fireworkhq
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

Hi @jackton1 , I tried what you mentioned in #479, but it still turns out not working.
I tried with both v19 and v20 but always get "Non Matching modified files".

To Reproduce

  1. with this Workflow:
jobs:
  mark-header-automate:
    runs-on: ubuntu-latest
    steps:
      - name: Check out a copy of the repo
        uses: actions/checkout@v3
        with:
          fetch-depth: 2
          path: main

      - name: Get changed files
        id: changed-files
        uses: tj-actions/changed-files@v20
        with:
          since_last_remote_commit: "true"
          path: main
          files: |
            *.md
            **/*.md
            **/**/*.md
            **/**/**/*.md
            **/**/**/**/*.md
            **/**/**/**/**/*.md
            **/**/**/**/**/**/*.md
            **/**/**/**/**/**/**/*.md
            **/**/**/**/**/**/**/**/*.md
            **/**/**/**/**/**/**/**/**/*.md
            **/**/**/**/**/**/**/**/**/**/*.md
          files_ignore: |
            *.yml
            **/*.yml
            *.png
            **/*.png
  1. Push a changed file.
  2. Check the action logs.

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

@jack-fireworkhq That’s because the pattern itself is invalid.

You’ll need to remove the single quotes you have around the pattern.

files: |
   '**/*.md'

Should be modified to

files: ‘**/*.md’

OR

files: |
   **/*.md

Originally posted by @jackton1 in #479 (comment)

I expect what you mentioned above should be able to work.

Relevant log output

Run tj-actions/changed-files@v20
  with:
    since_last_remote_commit: true
    path: main
    files: *.md
  **/*.md
  **/**/*.md
  **/**/**/*.md
  **/**/**/**/*.md
  **/**/**/**/**/*.md
  **/**/**/**/**/**/*.md
  **/**/**/**/**/**/**/*.md
  **/**/**/**/**/**/**/**/*.md
  **/**/**/**/**/**/**/**/**/*.md
  **/**/**/**/**/**/**/**/**/**/*.md
  
    files_ignore: *.yml
  **/*.yml
  *.png
  **/*.png
  
    token: ***
    separator:  
    old_new_separator: ,
    old_new_files_separator:  
    files_separator: 
  
    files_ignore_separator: 
  
    sha: d22d8253089eb7db9164851242f7f0afd3752862
    use_fork_point: false
    quotepath: true
Run # "Set base sha..."
  # "Set base sha..."
  if [[ -n "" ]]; then
    echo "::set-output name=base_sha::"
  elif [[ "true" == "true" && "99ad4c1f842d5749f56c8f004c61e5ce50e1b0f7" != "0000000000000000000000000000000000000000" ]]; then
      echo "::set-output name=base_sha::99ad4c1f842d5749f56c8f004c61e5ce50e1b0f7"
  fi
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
Run # "Calculating the previous and current SHA..."
  # "Calculating the previous and current SHA..."
  bash $GITHUB_ACTION_PATH/diff-sha.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    GITHUB_SERVER_URL: https://github.com
    GITHUB_REPOSITORY: loopsocial/github_to_confluence
    GITHUB_BASE_REF: 
    GITHUB_HEAD_REF: 
    GITHUB_ACTION_PATH: /home/runner/work/_actions/tj-actions/changed-files/v20
    INPUT_SHA: d22d8253089eb7db9164851242f7f0afd3752862
    INPUT_BASE_SHA: 99ad4c1f842d5749f56c8f004c61e5ce50e1b0f7
    INPUT_TOKEN: ***
    INPUT_PATH: main
    INPUT_USE_FORK_POINT: false
changed-files-diff-sha
  Resolving repository path...
  Getting HEAD SHA...
Run tj-actions/glob@v7.20
  with:
    files: *.md
  **/*.md
  **/**/*.md
  **/**/**/*.md
  **/**/**/**/*.md
  **/**/**/**/**/*.md
  **/**/**/**/**/**/*.md
  **/**/**/**/**/**/**/*.md
  **/**/**/**/**/**/**/**/*.md
  **/**/**/**/**/**/**/**/**/*.md
  **/**/**/**/**/**/**/**/**/**/*.md
  
    files-separator: 
  
    escape-paths: true
    excluded-files: *.yml
  **/*.yml
  *.png
  **/*.png
  
    excluded-files-separator: 
  
    working-directory: main
    base-sha: 99ad4c1f842d5749f56c8f004c61e5ce50e1b0f7
    sha: d22d8253089eb7db9164851242f7f0afd3752862
    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
/usr/bin/git rev-parse --show-toplevel
/home/runner/work/github_to_confluence/github_to_confluence/main
/usr/bin/git diff --diff-filter=D --name-only 99ad4c1f842d5749f56c8f004c61e5ce50e1b0f7 d22d8253089eb7db9164851242f7f0afd3752862


Successfully created paths-output-file: /tmp/13637c46-60de-4b9d-9d92-e487a5a3b5f4.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:
    GITHUB_ACTION_PATH: /home/runner/work/_actions/tj-actions/changed-files/v20
    INPUT_FILES_PATTERN_FILE: /tmp/13637c46-60de-4b9d-9d92-e487a5a3b5f4.txt
    INPUT_SEPARATOR:  
    INPUT_PATH: main
    INPUT_PREVIOUS_SHA: 99ad4c1f842d5749f56c8f004c61e5ce50e1b0f7
    INPUT_CURRENT_SHA: d22d8253089eb7db9164851242f7f0afd3752862
    INPUT_TARGET_BRANCH: github_to_confluence~1
    INPUT_CURRENT_BRANCH: github_to_confluence
    INPUT_QUOTEPATH: true
    INPUT_OLD_NEW_SEPARATOR: ,
    INPUT_OLD_NEW_FILES_SEPARATOR:  
changed-files
  Resolving repository path...
  Retrieving changes between 99ad4c1f842d5749f56c8f004c61e5ce50e1b0f7 (github_to_confluence~1) → d22d8253089eb7db9164851242f7f0afd3752862 (github_to_confluence)
  Getting diff...
  Non Matching changed files: specs/data-tracking/pixel-tracking/ad/new_file.md
  Non Matching modified files: specs/data-tracking/pixel-tracking/ad/new_file.md
  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: 
  All old & new renamed files:

Anything else?

1652693765
1652693793

I tried a lot🤣, but none of them worked. Let me know if you need anything more to work on this, thanks.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jack-fireworkhq jack-fireworkhq added the bug Something isn't working label May 16, 2022
@jackton1
Copy link
Member

jackton1 commented May 16, 2022

@jack-fireworkhq I'll suggest simplifying your configuration

      - name: Run changed-files
        id: changed-files
        uses: tj-actions/changed-files@v20
        with:
          path: main
          files: |
            *.md
            **/*.md

Also since_last_remote_commit: true when using fetch-depth: 2 works because the action correctly detects this misconfiguration i.e you're saying compare the last remote commit but the checkout action fetches only 2 commits which in some cases doesn't have the previous remote commit.

See: https://github.com/tj-actions/changed-files#example for more options

A working example can be found here: #493

Note: You can also test this using https://github.com/tj-actions/glob which handles all file patterns to validate your setup.

@jackton1 jackton1 reopened this May 16, 2022
@jackton1 jackton1 linked a pull request May 16, 2022 that will close this issue
@jack-fireworkhq
Copy link
Author

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants