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

.git not found when using working-directory #149

Open
wmcheung opened this issue May 19, 2022 · 4 comments
Open

.git not found when using working-directory #149

wmcheung opened this issue May 19, 2022 · 4 comments
Assignees

Comments

@wmcheung
Copy link

I'm using vercel-action only to deploy to Vercel, while the build is done in Github Actions

      - name: Checkout main repo
        uses: actions/checkout@v3
        with:
          path: main
          fetch-depth: 0

      - name: Checkout UI
        uses: actions/checkout@v3
        with:
          repository: company/some-repo
          path: ui

     # the rest of the steps to perform a build

      - uses: amondnet/vercel-action@v19 #deploy
         with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }} 
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}}
          working-directory: main

What I've encountered is that the working-directory is called after running a git log. Which means that deploy is not happening inside the working-directory. Vercel action will try to look for history using git in the root where no .git is available.

My current workaround is to have the main repo without a path. But for multi checkout purpose I think the index.js file should be updated to have a path option to tell vercel-action where the root of the project is? While having working-directory option to provide the full path of the static build?

let commit = execSync('git log -1 --pretty=format:%B')
.

vercel-action/index.js

Lines 114 to 116 in f445edf

if (workingDirectory) {
options.cwd = workingDirectory;
}

@amondnet amondnet self-assigned this Jun 8, 2022
@amondnet
Copy link
Owner

@wmcheung Try this.

uses: amondnet/vercel-action@e610ddb0e844d1a22c4b27560c224f84f20f3061
with:
  working-directory: your-working-dir
  git-directory: your-git-dir

@nazariyv
Copy link

nazariyv commented Jul 3, 2023

I had the same issue, and running this action off that commit works well. However, this is a nit, I am using VSCode with github extension and apparently it lints actions and I can see that this commit marks zeit-token as required (although, workflow runs with no issues). This isn't the case with v25 of this action, there is no such linting issue.

@blavejr
Copy link

blavejr commented Feb 16, 2024

Will this be fixed? I am experiencing the same issue

@EvanNotFound
Copy link

Same issue here

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

When branches are created from issues, their pull requests are automatically linked.

5 participants