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

Failure on private repositories with LFS enabled #63

Open
siennathesane opened this issue Aug 7, 2024 · 2 comments
Open

Failure on private repositories with LFS enabled #63

siennathesane opened this issue Aug 7, 2024 · 2 comments
Assignees

Comments

@siennathesane
Copy link

Using the default configuration, with LFS enabled in the repository, the action fails to run on private repositories.

Config

Here is an MVCE of the workflow in a private repository. The repository has LFS enabled and has several LFS-tracked files that are required for build time.

on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
        with:
          lfs: true
      - uses: bufbuild/buf-action@v1

Action Output

Repo name, diffs, and commits sanitized for security.

Run bufbuild/buf-action@v1
  with:
    domain: buf.build
    github_actor: siennathesane
    github_token: ***
    setup_only: false
    pr_comment: true
    exclude_imports: false
    lint: true
    format: true
    breaking: true
    push: false
    push_disable_create: false
    archive: false
  
Using the latest release of buf: 1.36.0
Downloading buf (1.36.0)
/usr/bin/chmod +x /home/runner/work/_temp/e508b503-8d04-4d66-9[2](https://github.com/jamf/<internal>/actions/runs/10289871862/job/28478538880?pr=104#step:6:2)a5-edd5[3](https://github.com/jamf/<internal>/actions/runs/10289871862/job/28478538880?pr=104#step:6:3)8baaf47
Setup buf (1.36.0) at /opt/hostedtoolcache/buf/1.36.0/x6[4](https://github.com/jamf/<internal>/actions/runs/10289871862/job/28478538880?pr=104#step:6:4)
/opt/hostedtoolcache/buf/1.36.0/x64/buf config ls-modules --format name
/opt/hostedtoolcache/buf/1.36.0/x64/buf build --error-format github-actions
/opt/hostedtoolcache/buf/1.36.0/x64/buf lint --error-format github-actions
/opt/hostedtoolcache/buf/1.36.0/x64/buf format --diff --error-format github-actions --exit-code
/opt/hostedtoolcache/buf/1.36.0/x64/buf breaking --error-format github-actions --against https://github.com/jamf/<internal>.git#format=git,commit=[5](https://github.com/jamf/<internal>/actions/runs/10289871862/job/28478538880?pr=104#step:6:5)92cd200d6ee76af541[6](https://github.com/jamf/<internal>/actions/runs/10289871862/job/28478538880?pr=104#step:6:6)b116809a0aaf7fd94b3[7](https://github.com/jamf/<internal>/actions/runs/10289871862/job/28478538880?pr=104#step:6:7)

**diff hidden**

Error: Format diff -1/+1.
Error: Format diff -2/+3.
Failure: could not clone https://github.com/jamf/<internal>.git: exit status 128
fatal: could not read Username for 'https://github.com': No such device or address
Downloading <lfs file> ([9](https://github.com/jamf/<internal>/actions/runs/10289871862/job/28478538880?pr=104#step:6:9)34 B)
fatal: could not read Username for 'https://github.com': No such device or address
Error downloading object: <lfs file> (de3d4cc): Smudge error: Error downloading <lfs file> (<commitish>): batch response: Git credentials for https://github.com/jamf/<internal>.git not found.
Errors logged to '/tmp/9b99ee6f-337a-413a-b4c1-4083bfd7cbd73128840361/.git/lfs/logs/20240807T183654.28592243.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: <lfs file>: smudge filter lfs failed
Commented 2274098425 on PR #[10](https://github.com/jamf/<internal>/actions/runs/10289871862/job/28478538880?pr=104#step:6:10)4
Error: Failed format
Error: Failed breaking
@emcfarlane
Copy link
Collaborator

Hi @siennathesane , thanks for the detailed issue. Will have a look at fixing the authentication problem for LFS. As a workaround for now you can checkout both the head and base targets of the breaking change detection to avoid the git pull. See the specifying inputs guide: https://github.com/bufbuild/buf-action?tab=readme-ov-file#specify-the-input-directory

on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
        with:
          lfs: true
          path: head
      - uses: actions/checkout@v4
        with:
          lfs: true
          path: base
          ref: ${{ github.event.pull_request.base.sha }}
      - uses: bufbuild/buf-action@v1
        with:
          token: ${{ secrets.BUF_TOKEN }} # Required for push events.
          input: head
          breaking_against: base

@barakugav
Copy link

+1

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

No branches or pull requests

3 participants