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] Failing to retrieve master branch if depth isn't 0 #988

Closed
3 tasks done
FredericEspiau opened this issue Feb 15, 2023 · 4 comments · Fixed by #980 or #989
Closed
3 tasks done

[BUG] Failing to retrieve master branch if depth isn't 0 #988

FredericEspiau opened this issue Feb 15, 2023 · 4 comments · Fixed by #980 or #989
Labels
bug Something isn't working

Comments

@FredericEspiau
Copy link

FredericEspiau commented Feb 15, 2023

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?

Hey,

the action fails as it can't seem to find the master branch, I get this error message

2023-02-15T10:50:15.4178004Z ##[group]changed-files-diff-sha
2023-02-15T10:50:15.4178413Z Verifying git version...
2023-02-15T10:50:15.4217128Z Valid git version found: (2.38.1)
2023-02-15T10:50:15.4221653Z Running on a pull request event...
2023-02-15T10:50:15.4256527Z fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
2023-02-15T10:50:15.4257192Z Use '--' to separate paths from revisions, like this:
2023-02-15T10:50:15.4257751Z 'git <command> [<revision>...] -- [<file>...]'
2023-02-15T10:50:15.4301079Z ##[error]Unable to locate the previous sha: origin/master
2023-02-15T10:50:15.4307958Z ##[error]Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than 50.
2023-02-15T10:50:15.4309878Z ##[error]Process completed with exit code 1.

I've tried configuring actions/checkout with the following

  • using the name of the branch as a ref
  • setting a depth of 2 or 50

Only setting the depth to 0 works but has it's a monorepo it takes a long time to proceed

sorry if this is an issue with my configuration and thanks for the hard work

To Reproduce

- uses: actions/checkout@v3

- name: Run ESLint on changed files
   uses: tj-actions/eslint-changed-files@v18
      with:
        path: "services/api"
        file_extensions: "src/**/*.{ts,tsx,js,jsx}"
        extra_args: "--rulesdir src/eslint/rules"
        config_path: ".eslintrc.js"

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

Being able to operate I guess

Relevant log output

2023-02-15T10:48:13.5658738Z ##[group]Run actions/checkout@v3
2023-02-15T10:48:13.5658980Z with:
2023-02-15T10:48:13.5659150Z   repository: mycompany/monorepo
2023-02-15T10:48:13.5659440Z   token: ***
2023-02-15T10:48:13.5659591Z   ssh-strict: true
2023-02-15T10:48:13.5659762Z   persist-credentials: true
2023-02-15T10:48:13.5659933Z   clean: true
2023-02-15T10:48:13.5660077Z   fetch-depth: 1
2023-02-15T10:48:13.5660220Z   lfs: false
2023-02-15T10:48:13.5660367Z   submodules: false
2023-02-15T10:48:13.5660532Z   set-safe-directory: true
2023-02-15T10:48:13.5661047Z ##[endgroup]
2023-02-15T10:48:13.6788503Z Syncing repository: mycompany/monorepo
2023-02-15T10:48:13.6789974Z ##[group]Getting Git version info
2023-02-15T10:48:13.6790379Z Working directory is '/runner/_work/monorepo/monorepo'
2023-02-15T10:48:13.6790746Z [command]/usr/bin/git version
2023-02-15T10:48:13.6790997Z git version 2.38.1
2023-02-15T10:48:13.6792090Z ##[endgroup]
2023-02-15T10:48:13.6803802Z Temporarily overriding HOME='/runner/_work/_temp/fa6e01f6-dc6b-480a-885a-63ac35e2090a' before making global git config changes
2023-02-15T10:48:13.6804326Z Adding repository directory to the temporary git global config as a safe directory
2023-02-15T10:48:13.6807109Z [command]/usr/bin/git config --global --add safe.directory /runner/_work/monorepo/monorepo
2023-02-15T10:48:13.6842258Z Deleting the contents of '/runner/_work/monorepo/monorepo'
2023-02-15T10:48:13.6845965Z ##[group]Initializing the repository
2023-02-15T10:48:13.6848758Z [command]/usr/bin/git init /runner/_work/monorepo/monorepo
...
2023-02-15T10:48:13.6887723Z Initialized empty Git repository in /runner/_work/monorepo/monorepo/.git/
2023-02-15T10:48:13.6895552Z [command]/usr/bin/git remote add origin https://github.com/mycompany/monorepo
2023-02-15T10:48:13.6928555Z ##[endgroup]
2023-02-15T10:48:13.6928916Z ##[group]Disabling automatic garbage collection
2023-02-15T10:48:13.6931670Z [command]/usr/bin/git config --local gc.auto 0
2023-02-15T10:48:13.6957257Z ##[endgroup]
2023-02-15T10:48:13.6957552Z ##[group]Setting up auth
2023-02-15T10:48:13.6963413Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-02-15T10:48:13.6989300Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-02-15T10:48:13.7160201Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-02-15T10:48:13.7188312Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-02-15T10:48:13.7363684Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2023-02-15T10:48:13.7397612Z ##[endgroup]
2023-02-15T10:48:13.7398059Z ##[group]Fetching the repository
2023-02-15T10:48:13.7405996Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +e32ff2f06e4123b320cfe352888444323a43db8d:refs/remotes/pull/10662/merge
...
2023-02-15T10:48:19.0346120Z From https://github.com/mycompany/monorepo
2023-02-15T10:48:19.0346701Z  * [new ref]         e32ff2f06e4123b320cfe352888444323a43db8d -> pull/10662/merge
2023-02-15T10:48:19.0364498Z ##[endgroup]
2023-02-15T10:48:19.0364842Z ##[group]Determining the checkout info
2023-02-15T10:48:19.0366626Z ##[endgroup]
2023-02-15T10:48:19.0366901Z ##[group]Checking out the ref
2023-02-15T10:48:19.0370279Z [command]/usr/bin/git checkout --progress --force refs/remotes/pull/10662/merge
2023-02-15T10:48:19.7065792Z Note: switching to 'refs/remotes/pull/10662/merge'.

...

2023-02-15T10:48:19.7068783Z HEAD is now at e32ff2f Merge 04043766d7aa69fdf80045254d27f7cfef85ddfa into 086da92a290afb508a160f3d265c529ca4d99196
2023-02-15T10:48:19.7098148Z ##[endgroup]
2023-02-15T10:48:19.7135224Z [command]/usr/bin/git log -1 --format='%H'
2023-02-15T10:48:19.7159106Z 'e32ff2f06e4123b320cfe352888444323a43db8d'
...
2023-02-15T10:50:14.5049585Z ##[group]Run tj-actions/eslint-changed-files@v18
2023-02-15T10:50:14.5049787Z with:
2023-02-15T10:50:14.5049928Z   path: services/api
2023-02-15T10:50:14.5050116Z   file_extensions: src/**/*.{ts,tsx,js,jsx}
2023-02-15T10:50:14.5050308Z   extra_args: --rulesdir src/eslint/rules
2023-02-15T10:50:14.5050490Z   config_path: .eslintrc.js
2023-02-15T10:50:14.5050753Z   token: ***
2023-02-15T10:50:14.5050885Z   all_files: false
2023-02-15T10:50:14.5051039Z   skip_annotations: false
2023-02-15T10:50:14.5051195Z   level: error
2023-02-15T10:50:14.5051350Z   reporter: github-pr-review
2023-02-15T10:50:14.5051517Z   filter_mode: added
2023-02-15T10:50:14.5051678Z   fail_on_error: true
2023-02-15T10:50:14.5052116Z ##[endgroup]
2023-02-15T10:50:14.5245677Z ##[group]Run reviewdog/action-setup@v1
2023-02-15T10:50:14.5245857Z with:
2023-02-15T10:50:14.5245996Z   reviewdog_version: v0.14.1
2023-02-15T10:50:14.5246471Z ##[endgroup]
2023-02-15T10:50:14.5259238Z ##[group]Run $GITHUB_ACTION_PATH/install.sh
2023-02-15T10:50:14.5259460Z �[36;1m$GITHUB_ACTION_PATH/install.sh�[0m
2023-02-15T10:50:14.5274699Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2023-02-15T10:50:14.5274893Z env:
2023-02-15T10:50:14.5275221Z   REVIEWDOG_VERSION: v0.14.1
2023-02-15T10:50:14.5275398Z   REVIEWDOG_TEMPDIR: /runner/_work/_temp
2023-02-15T10:50:14.5275570Z ##[endgroup]
2023-02-15T10:50:14.5325654Z ##[group]🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog
2023-02-15T10:50:14.7890704Z reviewdog/reviewdog info checking GitHub for tag 'v0.14.1'
2023-02-15T10:50:14.8443530Z reviewdog/reviewdog info found version: 0.14.1 for v0.14.1/Linux/x86_64
2023-02-15T10:50:15.3710046Z reviewdog/reviewdog info installed /runner/_work/_temp/reviewdog/bin/reviewdog
2023-02-15T10:50:15.3745925Z ##[endgroup]
2023-02-15T10:50:15.3774155Z ##[group]Run echo "::group::📖 reviewdog -h"
2023-02-15T10:50:15.3774460Z �[36;1mecho "::group::📖 reviewdog -h"�[0m
2023-02-15T10:50:15.3774694Z �[36;1mreviewdog -h 2>&1 || true�[0m
2023-02-15T10:50:15.3774901Z �[36;1mecho "::endgroup::"�[0m
2023-02-15T10:50:15.3789741Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2023-02-15T10:50:15.3790472Z ##[endgroup]
2023-02-15T10:50:15.4095449Z ##[group]Run tj-actions/changed-files@v35
2023-02-15T10:50:15.4095617Z with:
2023-02-15T10:50:15.4095758Z   path: services/api
2023-02-15T10:50:15.4095922Z   files: src/**/*.{ts,tsx,js,jsx}
2023-02-15T10:50:15.4096089Z   diff_relative: true
2023-02-15T10:50:15.4096231Z   separator:  
2023-02-15T10:50:15.4096398Z   include_all_old_new_renamed_files: false
2023-02-15T10:50:15.4096571Z   old_new_separator: ,
2023-02-15T10:50:15.4096732Z   old_new_files_separator:  
2023-02-15T10:50:15.4096882Z   files_separator: 

2023-02-15T10:50:15.4097038Z   files_ignore_separator: 

2023-02-15T10:50:15.4097200Z   quotepath: true
2023-02-15T10:50:15.4097343Z   dir_names: false
2023-02-15T10:50:15.4097489Z   dir_names_exclude_root: false
2023-02-15T10:50:15.4097649Z   json: false
2023-02-15T10:50:15.4097795Z   json_raw_format: false
2023-02-15T10:50:15.4097943Z   fetch_depth: 50
2023-02-15T10:50:15.4098089Z   since_last_remote_commit: false
2023-02-15T10:50:15.4098252Z   write_output_files: false
2023-02-15T10:50:15.4098416Z   output_dir: .github/outputs
2023-02-15T10:50:15.4098580Z   match_directories: true
2023-02-15T10:50:15.4099010Z ##[endgroup]
2023-02-15T10:50:15.4118155Z ##[group]Run # "Calculating the previous and current SHA..."
2023-02-15T10:50:15.4118403Z �[36;1m# "Calculating the previous and current SHA..."�[0m
2023-02-15T10:50:15.4118693Z �[36;1mbash $GITHUB_ACTION_PATH/diff-sha.sh�[0m
2023-02-15T10:50:15.4133082Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2023-02-15T10:50:15.4133276Z env:
2023-02-15T10:50:15.4133627Z   GITHUB_SERVER_URL: https://github.com
2023-02-15T10:50:15.4133825Z   GITHUB_REPOSITORY: mycompany/monorepo
2023-02-15T10:50:15.4134017Z   GITHUB_REF: refs/pull/10662/merge
2023-02-15T10:50:15.4134215Z   GITHUB_SHA: e32ff2f06e4123b320cfe352888444323a43db8d
2023-02-15T10:50:15.4134432Z   GITHUB_WORKSPACE: /runner/_work/monorepo/monorepo
2023-02-15T10:50:15.4134628Z   GITHUB_EVENT_HEAD_REPO_FORK: false
2023-02-15T10:50:15.4134807Z   GITHUB_EVENT_PULL_REQUEST_NUMBER: 10662
2023-02-15T10:50:15.4135002Z   GITHUB_EVENT_PULL_REQUEST_BASE_REF: master
2023-02-15T10:50:15.4135211Z   GITHUB_EVENT_PULL_REQUEST_HEAD_REF: ci/api-eslint
2023-02-15T10:50:15.4135447Z   GITHUB_EVENT_PULL_REQUEST_BASE_SHA: 086da92a290afb508a160f3d265c529ca4d99196
2023-02-15T10:50:15.4135695Z   GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: 04043766d7aa69fdf80045254d27f7cfef85ddfa
2023-02-15T10:50:15.4135904Z   GITHUB_EVENT_PULL_REQUEST_COMMITS: 1
2023-02-15T10:50:15.4136113Z   GITHUB_EVENT_BEFORE: 4d530e4522e7867a5dcb021bde8c0e797d016704
2023-02-15T10:50:15.4136304Z   GITHUB_EVENT_FORCED: 
2023-02-15T10:50:15.4136530Z   GITHUB_REFNAME: 10662/merge
2023-02-15T10:50:15.4136691Z   INPUT_SHA: 
2023-02-15T10:50:15.4136836Z   INPUT_BASE_SHA: 
2023-02-15T10:50:15.4136981Z   INPUT_SINCE: 
2023-02-15T10:50:15.4137113Z   INPUT_UNTIL: 
2023-02-15T10:50:15.4137256Z   INPUT_PATH: services/api
2023-02-15T10:50:15.4137419Z   INPUT_FETCH_DEPTH: 50
2023-02-15T10:50:15.4137592Z   INPUT_SINCE_LAST_REMOTE_COMMIT: false
2023-02-15T10:50:15.4137753Z ##[endgroup]
2023-02-15T10:50:15.4178004Z ##[group]changed-files-diff-sha
2023-02-15T10:50:15.4178413Z Verifying git version...
2023-02-15T10:50:15.4217128Z Valid git version found: (2.38.1)
2023-02-15T10:50:15.4221653Z Running on a pull request event...
2023-02-15T10:50:15.4256527Z fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
2023-02-15T10:50:15.4257192Z Use '--' to separate paths from revisions, like this:
2023-02-15T10:50:15.4257751Z 'git <command> [<revision>...] -- [<file>...]'
2023-02-15T10:50:15.4301079Z ##[error]Unable to locate the previous sha: origin/master
2023-02-15T10:50:15.4307958Z ##[error]Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than 50.
2023-02-15T10:50:15.4309878Z ##[error]Process completed with exit code 1.

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@FredericEspiau FredericEspiau added the bug Something isn't working label Feb 15, 2023
@jackton1 jackton1 transferred this issue from tj-actions/eslint-changed-files Feb 16, 2023
@github-actions
Copy link
Contributor

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

@jackton1 jackton1 reopened this Feb 16, 2023
@jackton1 jackton1 transferred this issue from tj-actions/changed-files Feb 16, 2023
@jackton1 jackton1 transferred this issue from tj-actions/eslint-changed-files Feb 16, 2023
@github-actions
Copy link
Contributor

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

@jackton1 jackton1 linked a pull request Feb 16, 2023 that will close this issue
@FredericEspiau
Copy link
Author

Thank you @jackton1 it does work ! Unfortunately it takes about 6 minutes to download the whole history 😞 . Isn't there a way to get it to work quicker ?

@jackton1
Copy link
Member

jackton1 commented Feb 17, 2023

@FredericEspiau You can control the size of the history retrieved via the fetch_depth input

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
2 participants