Skip to content

Checking out a sub-path using git-lfs #66

Closed
@asheesh-reduct

Description

@asheesh-reduct

Hi there!

(BTW -- GitHub actions, and this checkout action, are both excellent, so I want to start by saying thank you!)

At $WORK, we use a mono-repo-style repository. Therefore, our GitHub Actions events usually only affect one sub-directory of the repository. We use git-lfs to store some files, so I enabled the lfs checkout in the checkout action.

Unfortunately, this has resulted in a huge amount of LFS bandwidth on our end, sadly, so I'd like to try another approach.

I'd like either (a) a built-in way for the checkout action to only check out lfs data from some paths, or (b) to figure out how to do that myself. I'd be happy to do (b), except I can't figure out how the checkout action is authenticating to lfs to download its data.

Here's a sample YAML file that shows what I'm trying:

name: reduct-app build smoke-test

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x]
    steps:
      - uses: actions/checkout@v1
        with:
          fetch-depth: 1
      - name: Get reduct-app git-lfs files
        run: |
          echo $GITHUB_TOKEN
          echo ${{ github.token }}
          echo ${{ secrets.GITHUB_TOKEN }}
          git -c http.https://github.com.extraheader="AUTHORIZATION: basic ${{ secrets.GITHUB_TOKEN }}" lfs pull --include reduct-app/
          git -c http.https://github.com.extraheader="AUTHORIZATION: basic $GITHUB_TOKEN" lfs checkout reduct-app/
        #env:
        #  GITHUB_TOKEN: ${{ secrets.CLONE_TOKEN }}
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: yarn install
        run: |
          cd reduct-app && yarn install --frozen-lockfile
      - name: yarn build
        run: |
          cd reduct-app && yarn build --all
        env:
          CI: true

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions