forked from Skynet/actions
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'
|
description: 'Pass in gitea.ref_name'
|
||||||
required: true
|
required: true
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: 'docker'
|
||||||
steps:
|
image: 'Dockerfile'
|
||||||
- name: "Pull LFS objects"
|
args:
|
||||||
shell: bash
|
- ${{ inputs.repository }}
|
||||||
run: |
|
- ${{ inputs.ref_name }}
|
||||||
UrlBase=$GITHUB_SERVER_URL; \
|
- ${{ 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 }}
|
|
||||||
|
|
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