Github actions actions / checkout@v2 lfs: true флаг не преобразует указатели в реальные файлы - PullRequest
0 голосов
/ 27 апреля 2020

Это мой файл github actions yml:

name: CI

on: [pull_request]

jobs:
  build_ios:
    name: Set up
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [self-hosted]
        node-version: [10.x]

    steps:
      - name: Checkout github repo (+ download lfs dependencies)
        uses: actions/checkout@v2
        with:
          lfs: true

После запуска я ожидаю, что все файлы git lfs будут загружены, извлечены и готовы к использованию, но вместо содержимого файла это:

version https://git-lfs.github.com/spec/v1
oid sha256:f23e4c2b1244bc93085dbccf17c447e54sca44650294648df128d58303e4eff
size 58951008

Ниже я прилагаю фактический журнал действий GitHub в случае, если это полезно:

Run actions/checkout@v2
  with:
    lfs: true
    repository: SudoPlz/test-project-mobile
    token: ***
    ssh-strict: true
    persist-credentials: true
    clean: true
    fetch-depth: 1
    submodules: false
Syncing repository: SudoPlz/test-project-mobile
Getting Git version info
  Working directory is '/Users/sudoplz/Development/tmp/actions-runner/_work/test-project-mobile/test-project-mobile'
  /usr/bin/git version
  git version 2.24.1 (Apple Git-126)
  /usr/bin/git lfs version
  git-lfs/2.8.0 (GitHub; darwin amd64; go 1.12.7)
/usr/bin/git config --local --get remote.origin.url
https://github.com/SudoPlz/test-project-mobile
Removing previously created refs, to avoid conflicts
  /usr/bin/git rev-parse --symbolic-full-name --verify --quiet HEAD
  HEAD
  /usr/bin/git rev-parse --symbolic-full-name --branches
  /usr/bin/git rev-parse --symbolic-full-name --remotes=origin
Cleaning the repository
  /usr/bin/git clean -ffdx
  Removing .jest/
  Removing node_modules/
  Removing patchLog.txt
  /usr/bin/git reset --hard HEAD
  HEAD is now at 21bea25da Merge ab95479fd7dce51551520250ac521532d0079f94 into c70ec18b35029c581b0c0e06566228f69e091d3d
Disabling automatic garbage collection
  /usr/bin/git config --local gc.auto 0
Setting up auth
  /usr/bin/git config --local --name-only --get-regexp core\.sshCommand
  /usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
  /usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
  /usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
  /usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
/usr/bin/git lfs install --local
Updated git hooks.
Git LFS initialized.
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +d4be6d58e6a72e54b0b03be61fc508dcee8d7bec:refs/remotes/pull/44/merge
  remote: Enumerating objects: 10, done.        
  remote: Counting objects:  10% (1/10)        
  remote: Counting objects:  20% (2/10)        
  remote: Counting objects:  30% (3/10)        
  remote: Counting objects:  40% (4/10)        
  remote: Counting objects:  50% (5/10)        
  remote: Counting objects:  60% (6/10)        
  remote: Counting objects:  70% (7/10)        
  remote: Counting objects:  80% (8/10)        
  remote: Counting objects:  90% (9/10)        
  remote: Counting objects: 100% (10/10)        
  remote: Counting objects: 100% (10/10), done.        
  remote: Compressing objects:  33% (1/3)        
  remote: Compressing objects:  66% (2/3)    
  remote: Compressing objects: 100% (3/3)        
  remote: Compressing objects: 100% (3/3), done.        
  remote: Total 5 (delta 2), reused 2 (delta 0), pack-reused 0        
  From https://github.com/SudoPlz/test-project-mobile
   + 21bea25da...d4be6d58e d4be6d58e6a72e54b0b03be61fc508dcee8d7bec -> pull/44/merge  (forced update)
Determining the checkout info
Fetching LFS objects
  /usr/bin/git lfs fetch origin refs/remotes/pull/44/merge
  fetch: Fetching reference refs/remotes/pull/44/merge
Checking out the ref
  /usr/bin/git checkout --progress --force refs/remotes/pull/44/merge
  Warning: you are leaving 1 commit behind, not connected to
  any of your branches:

    21bea25da Merge ab95479fd7dce51551520250ac521532d0079f94 into c70ec18b35029c581b0c0e06566228f69e091d3d

  If you want to keep it by creating a new branch, this may be a good time
  to do so with:

   git branch <new-branch-name> 21bea25da

  HEAD is now at d4be6d58e Merge 8d05f53305eaef70a2d4635767b39dbfbe663b5a into c70ec18b35029c581b0c0e06566228f69e091d3d
/usr/bin/git log -1
commit d4be6d58e6a72e54b0b03be61fc508dcee8d7bec
Author: SudoPlz <*@*.*>
Date:   Fri Apr 24 18:38:50 2020 +0000

    Merge 8d05f53305eaef70a2d4635767b39dbfbe663b5a into c70ec18b35029c581b0c0e06566228f69e091d3d

1 Ответ

0 голосов
/ 27 апреля 2020

Кажется, что объекты LFS извлекаются только на основе журнала. Вам необходимо проверить порядок файлов LFS для замены файлов указателей их аналогами LFS. Вот попытка изменить actions.yml на основе поиска по GitHub Actions (никогда не использовал его ранее):

name: CI

on: [pull_request]

jobs:
  build_ios:
    name: Set up
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [self-hosted]
        node-version: [10.x]

    steps:
      - name: Checkout github repo (+ download lfs dependencies)
        uses: actions/checkout@v2
        with:
          lfs: true
      - name: Checkout LFS objects
        run: git lfs checkout

Если объекты LFS не были извлечены, вы можете заменить git lfs checkout на git lfs pull.

Соответствующие проблемы: Кэш для LFS

...