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] Fails in Self-Hosted Runner #477

Closed
3 tasks done
martindevnow opened this issue May 12, 2022 · 4 comments
Closed
3 tasks done

[BUG] Fails in Self-Hosted Runner #477

martindevnow opened this issue May 12, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@martindevnow
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?

A simple job, on a self-hosted runner (Linux) fails, with the following error:

Run tj-actions/changed-files@v19
Run # "Set base sha..."
Run # "Calculating the previous and current SHA..."
changed-files-diff-sha
  Resolving repository path...
  Setting up 'temp_changed_files' remote...
  No 'temp_changed_files' remote found
  Creating 'temp_changed_files' remote...
  fatal: not a git repository (or any of the parent directories): .git

To Reproduce

Create a simple job:

name: 'Test Check Files Changed Action'

on:
  push:
    branches: [my-feature-branch]

jobs:
  check_base_image_changed:
    name: Check Files Changed
    runs-on: [self-hosted]
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

      - name: Get Changed Files
        id: changed-files
        uses: tj-actions/changed-files@v19
        with:
          files: |
            Dockerfile
            package*.json

Use a self-hosted runner

Push a change to the branch

See the error

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04, ubuntu-18.04

Expected behavior?

I expect the job to be successful, and for me to be able to inspect the outputs of this step

Relevant log output

Run tj-actions/changed-files@v19
  with:
    files: Dockerfile
  package*.json
  
    token: ***
    separator:  
    files_separator: 
  
    files_ignore_separator: 
  
    sha: 92887a4c13c1fa2edd08a94368c60f69dddd1a52
    since_last_remote_commit: false
    use_fork_point: false
    quotepath: true
Run # "Set base sha..."
  # "Set base sha..."
  if [[ -n "" ]]; then
    echo "::set-output name=base_sha::"
  elif [[ "false" == "true" && "3be99cac35cadc74839f3525b3ba9fa603af48df" != "0000000000000000000000000000000000000000" ]]; then
      echo "::set-output name=base_sha::3be99cac35cadc74839f3525b3ba9fa603af48df"
  fi
  shell: /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: /bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    GITHUB_SERVER_URL: https://github.com
    GITHUB_REPOSITORY: org/repo
    GITHUB_BASE_REF: 
    GITHUB_HEAD_REF: 
    GITHUB_ACTION_PATH: /tmp/_actions/tj-actions/changed-files/v19
    INPUT_SHA: 92887a4c13c1fa2edd08a94368c60f69dddd1a52
    INPUT_BASE_SHA: 
    INPUT_TOKEN: ***
    INPUT_PATH: 
    INPUT_USE_FORK_POINT: false
changed-files-diff-sha
  Resolving repository path...
  Setting up 'temp_changed_files' remote...
  No 'temp_changed_files' remote found
  Creating 'temp_changed_files' remote...
  fatal: not a git repository (or any of the parent directories): .git
  Error: Process completed with exit code 128.

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@martindevnow martindevnow added the bug Something isn't working label May 12, 2022
@github-actions
Copy link
Contributor

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

@jackton1
Copy link
Member

@martindevnow Can you also include the logs from the checkout action as this seems like there was an error cloning the repository.

@martindevnow
Copy link
Author

Here are the logs from the Checkout step:

Run actions/checkout@v3
  with:
    fetch-depth: [2](https://github.com/[org]/[repo]/runs/6399668461?check_suite_focus=true#step:2:2)
    repository: [org]/[repo]
    token: ***
    ssh-strict: true
    persist-credentials: true
    clean: true
    lfs: false
    submodules: false
    set-safe-directory: true
Syncing repository: [org]/[repo]
Getting Git version info
  Working directory is '/tmp/[repo]/[repo]'
  /usr/bin/git version
  git version 2.17.1
Deleting the contents of '/tmp/[repo]/[repo]'
The repository will be downloaded using the GitHub REST API
To create a local Git repository instead, add Git 2.18 or higher to the PATH
Downloading the archive
Writing archive to disk
Extracting the archive
/bin/tar xz -C /tmp/[repo]/[repo]/042d0515-149c-4ab1-a08c-f4f5dbcbbc[3](https://github.com/[org]/[repo]/runs/6399668461?check_suite_focus=true#step:2:3)2 -f /tmp/[repo]/[repo]/0[4](https://github.com/[org]/[repo]/runs/6399668461?check_suite_focus=true#step:2:4)2d0[5](https://github.com/[org]/[repo]/runs/6399668461?check_suite_focus=true#step:2:5)15-149c-4ab1-a08c-f4f5dbcbbc32.tar.gz
Resolved version [org]-[repo]-0[6](https://github.com/[org]/[repo]/runs/6399668461?check_suite_focus=true#step:2:6)ea35d92122c6b64[8](https://github.com/[org]/[repo]/runs/6399668461?check_suite_focus=true#step:2:8)b[10](https://github.com/[org]/[repo]/runs/6399668461?check_suite_focus=true#step:2:10)688cab0ec6[14](https://github.com/[org]/[repo]/runs/6399668461?check_suite_focus=true#step:2:14)2b26a2f

@jackton1
Copy link
Member

jackton1 commented May 14, 2022

@martindevnow From the error it’s clear the the repository isn’t located in the working directory.

I’ll suggest you create a test repository using a minimal setup to reproduce this error since the line where the error occurs simply sets up a custom remote name.

Giving that this error is more of an implementation discrepancy as opposed to a real bug. I’ll close this issue with the intent of reopening it if there’s a public repository that can reproduce the error.

Also note that the fetch-depth in the checkout action should be an integer as opposed to a URL.

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

No branches or pull requests

2 participants