fixup! Fix git submodule authentication

This commit is contained in:
Fabian Hauser 2024-09-29 14:57:26 +03:00
parent 05a1a70826
commit f1895b1d12

View file

@ -1,5 +1,10 @@
name: 'Initialize CI Environment and Repository' name: 'Initialize CI Environment and Repository'
description: 'Initialize a CI environment with nix (and also checkout the repository recursively with LFS)' description: 'Initialize a CI environment with nix (and also checkout the repository recursively with LFS)'
inputs:
token:
description: 'OAUTH token to access repositories'
required: false
default: ${{ github.token }}
runs: runs:
using: "composite" using: "composite"
steps: steps:
@ -15,6 +20,6 @@ runs:
run: | run: |
git lfs install git lfs install
GIT_SERVER=`echo -n "$GITHUB_SERVER_URL" | sed "s%https://%%"` GIT_SERVER=`echo -n "$GITHUB_SERVER_URL" | sed "s%https://%%"`
echo "machine $GIT_SERVER\nlogin oauth2\npassword $GITHUB_TOKEN" > ~/.netrc echo -e "machine $GIT_SERVER\nlogin oauth2\npassword ${{ inputs.token }}" > ~/.netrc
# Disable clone protection to pull LFS as well # Disable clone protection to pull LFS as well
GIT_CLONE_PROTECTION_ACTIVE=false git clone --branch $GITHUB_REF_NAME --recurse-submodules $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . GIT_CLONE_PROTECTION_ACTIVE=false git clone --branch $GITHUB_REF_NAME --recurse-submodules $GITHUB_SERVER_URL/$GITHUB_REPOSITORY .