feat: testing use of docker for lfs pull
This commit is contained in:
parent
e9fe504751
commit
93d4087f76
3 changed files with 33 additions and 15 deletions
12
get_lfs/Dockerfile
Normal file
12
get_lfs/Dockerfile
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Container image that runs your code
|
||||
FROM node:16-bullseye
|
||||
|
||||
# make sure dependencies are installed
|
||||
RUN apt-get -y update
|
||||
RUN apt-get -y install git git-lfs
|
||||
|
||||
# Copies your code file from your action repository to the filesystem path `/` of the container
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
# Code file to execute when the docker container starts up (`entrypoint.sh`)
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
@ -8,18 +8,9 @@ inputs:
|
|||
description: 'Pass in gitea.ref_name'
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Pull LFS objects"
|
||||
shell: bash
|
||||
run: |
|
||||
UrlBase=$GITHUB_SERVER_URL; \
|
||||
UrlLfsBase=$UrlBase/${{ inputs.repository }}.git/info/lfs/objects; \
|
||||
Auth=`git config --get --local http.$UrlBase/.extraheader`; \
|
||||
git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \
|
||||
git config --local http.${UrlLfsBase}/.extraheader ''
|
||||
|
||||
git config --local lfs.transfer.maxretries 1
|
||||
|
||||
git lfs install
|
||||
git lfs pull origin ${{ inputs.ref_name }}
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
args:
|
||||
- ${{ inputs.repository }}
|
||||
- ${{ inputs.ref_name }}
|
||||
- ${{ github.server_url }}
|
||||
|
|
15
get_lfs/entrypoint.sh
Normal file
15
get_lfs/entrypoint.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh -l
|
||||
|
||||
export Repo=$1
|
||||
export RepoRef=$2
|
||||
export UrlBase=$3
|
||||
|
||||
export UrlLfsBase=${UrlBase}/${Repo}.git/info/lfs/objects
|
||||
export Auth=$(git config --get --local http.${UrlBase}/.extraheader)
|
||||
git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"
|
||||
git config --local http.${UrlLfsBase}/.extraheader ''
|
||||
|
||||
git config --local lfs.transfer.maxretries 1
|
||||
|
||||
git lfs install
|
||||
git lfs pull origin ${RepoRef}
|
Loading…
Reference in a new issue