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

[Feature] fetch HEAD without tags #220

Closed
2 tasks done
solarmosaic-kflorence opened this issue Oct 22, 2021 · 8 comments · Fixed by #225
Closed
2 tasks done

[Feature] fetch HEAD without tags #220

solarmosaic-kflorence opened this issue Oct 22, 2021 · 8 comments · Fixed by #225
Labels
enhancement New feature or request

Comments

@solarmosaic-kflorence
Copy link

Is this feature missing in the latest version?

  • I'm using the latest release

Is your feature request related to a problem? Please describe.

Using this on a monorepo with a lot of tags, it will cause minor slowness and more output over time (there are already hundreds of tags).

Describe the solution you'd like?

Tags don't seem to be necessary, so fetching can most likely be performed with --no-tags.

https://github.com/tj-actions/changed-files/blob/main/entrypoint.sh#L52

Describe alternatives you've considered?

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@solarmosaic-kflorence solarmosaic-kflorence added the enhancement New feature or request label Oct 22, 2021
@github-actions
Copy link
Contributor

Thanks for reporting this issue.

@jackton1
Copy link
Member

jackton1 commented Oct 23, 2021

Fetching tags would be due to specifying

      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

See: https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches

You can optionally switch to

      - uses: actions/checkout@v2
        with:
          fetch-depth: 2

@solarmosaic-kflorence
Copy link
Author

solarmosaic-kflorence commented Oct 25, 2021

Actually I'm just using:

- uses: actions/checkout@v2
- id: changed-files
  uses: tj-actions/changed-files@v10.1
  with:
    files: \.md$

But the fetching of tags comes from this action, see the link I left above: https://github.com/tj-actions/changed-files/blob/main/entrypoint.sh#L52 (or somewhere else in the "Getting HEAD info..." section).

@solarmosaic-kflorence
Copy link
Author

Here is the full output:

Run tj-actions/changed-files@v10.1
  with:
    files: \.md$
    token: ***
    separator:  
    sha: 82ea931449f71f36c9787b63c0fa2a6a7dd6c4ec
Run bash $GITHUB_ACTION_PATH/sourcefiles.sh
  bash $GITHUB_ACTION_PATH/sourcefiles.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    INPUT_FILES: \.md$
    INPUT_FILES_FROM_SOURCE_FILE: 
changed-files-from-source-file
  Input Files: \.md$
  All Unique Input files: \.md$
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_SERVER_URL: https://github.com
    GITHUB_REPOSITORY: XXX/YYY
    GITHUB_BASE_REF: master
    INPUT_SHA: 82ea931449f71f36c9787b63c0fa2a6a7dd6c4ec
    INPUT_BASE_SHA: 
    INPUT_TOKEN: ***
    INPUT_FILES: \.md$
    INPUT_SEPARATOR:  
    INPUT_PATH: 
changed-files
  Resolving repository path...
  Getting HEAD info...
  From https://github.com/XXX/YYY
   * [new branch]        master         -> master
   * LOTS OF TAGS [REDACTED]
  Retrieving changes between d6b53ca63502675cb89c7f9dba3ae85795bb615f (master) → 82ea931449f71f36c9787b63c0fa2a6a7dd6c4ec (feature/linting)
  Input files: \.md$
  Checking for file changes: "\.md$"...
  Matching modified files: [REDACTED]
  Non Matching modified files: [REDACTED]
  Matching deleted files: 
  Added files: 
  Copied files: 
  Deleted files: 
  Modified files: [REDACTED]
  Renamed files: 
  Type Changed files: 
  Unmerged files: 
  Unknown files: 
  All changed files: [REDACTED]

@jackton1 jackton1 reopened this Oct 25, 2021
@jackton1
Copy link
Member

jackton1 commented Oct 25, 2021

You're right, I can confirm that this is the case for pull_request* based events

jackton1 added a commit that referenced this issue Oct 25, 2021
jackton1 added a commit that referenced this issue Oct 25, 2021
@solarmosaic-kflorence
Copy link
Author

@jackton1 I guess this needs a release before it can be used. Feel free to poke me when that happens (I'm already using @v11 so should get it automatically when it rolls out).

@jackton1
Copy link
Member

jackton1 commented Oct 26, 2021

@solarmosaic-kflorence A new release should be available now https://github.com/tj-actions/changed-files/releases/tag/v11.1. Thanks

@solarmosaic-kflorence
Copy link
Author

Fix confirmed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants