This commit is contained in:
@@ -49,11 +49,13 @@ jobs:
|
|||||||
SHA: ${{ github.sha }}
|
SHA: ${{ github.sha }}
|
||||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
git config --global init.defaultBranch main
|
||||||
if [ -f "$GITHUB_WORKSPACE/Dockerfile" ]; then exit 0; fi
|
if [ -f "$GITHUB_WORKSPACE/Dockerfile" ]; then exit 0; fi
|
||||||
mkdir -p "$GITHUB_WORKSPACE"
|
mkdir -p "$GITHUB_WORKSPACE"
|
||||||
cd "$GITHUB_WORKSPACE"
|
cd "$GITHUB_WORKSPACE"
|
||||||
git init .
|
git init .
|
||||||
if [ -z "$TOKEN" ]; then
|
if [ -z "$TOKEN" ]; then
|
||||||
|
echo "Warning: GITHUB_TOKEN is not set. Attempting unauthenticated fetch (will fail for private repos)."
|
||||||
git fetch --depth=1 "$SERVER/$REPO.git" "$REF"
|
git fetch --depth=1 "$SERVER/$REPO.git" "$REF"
|
||||||
else
|
else
|
||||||
git -c http.extraHeader="Authorization: Bearer $TOKEN" fetch --depth=1 "$SERVER/$REPO.git" "$REF"
|
git -c http.extraHeader="Authorization: Bearer $TOKEN" fetch --depth=1 "$SERVER/$REPO.git" "$REF"
|
||||||
|
|||||||
Reference in New Issue
Block a user