name: 'Checkout with LFS' description: 'Checkout files with LFS enabled on a private Gitea repository. Normal LFS checkout fails because of header authentification' inputs: checkout-version: description: 'The version of the checkout action (e.g. "4")' required: false default: '4' runs: using: 'composite' steps: - name: Checkout if: ${{ inputs.checkout-version == '3' }} uses: actions/checkout@v3 with: lfs: false - name: Checkout LFS if: ${{ inputs.checkout-version == '3' }} run: | UrlBase=$GITHUB_SERVER_URL; \ UrlLfsBase=$UrlBase/${{ gitea.repository }}.git/info/lfs/objects; \ Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \ /usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \ /usr/bin/git config --local http.${UrlLfsBase}/.extraheader '' git config --local lfs.transfer.maxretries 1 /usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }} /usr/bin/git lfs checkout - name: Checkout if: ${{ inputs.checkout-version == '4' }} uses: actions/checkout@v4 with: lfs: false - name: Checkout LFS if: ${{ inputs.checkout-version == '4' }} run: | UrlBase=$GITHUB_SERVER_URL; \ UrlLfsBase=$UrlBase/${{ gitea.repository }}.git/info/lfs/objects; \ Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \ /usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \ /usr/bin/git config --local http.${UrlLfsBase}/.extraheader '' git config --local lfs.transfer.maxretries 1 /usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }} /usr/bin/git lfs checkout