-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
75 lines (64 loc) · 1.93 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Clone a GitHub repository.
inputs:
owner:
description: GitHub username who owns the repository.
default: ${{ github.event.repository.owner.login }}
repo:
description: GitHub repo name.
default: ${{ github.event.repository.name }}
branch:
description: Branch to clone.
default: ${{ github.head_ref }}
checkout:
description: Actually checkout the contents of the repository to the disk.
default: false
runs:
using: composite
steps:
- name: Cloning ${{ inputs.slug }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
SLUG: ${{ inputs.owner }}/${{ inputs.repo }}
run: |
export GIT_TERMINAL_PROMPT=0
export GCM_INTERACTIVE=Never
cd ..
time rm -rf ${{ inputs.repo }}
git config --global gc.auto 0
git config --global fetch.recurseSubmodules false
git config --global protocol.version 2
#git config --global core.compression 0
cat ~/.gitconfig
# Checkout if needed
if [[ '${{ inputs.checkout }}' != 'true' ]]; then
GIT_CLONE_ARGS="--no-checkout"
fi
# Clone a blobless repository and don't bother checking it out.
set -x
time git clone \
$GIT_CLONE_ARGS \
--filter=blob:none \
--no-tags \
--origin upstream \
--branch ${{ inputs.branch }} \
--verbose \
https://token:${GH_TOKEN}@github.com/${SLUG}.git
set +x
# Enter cloned repository
cd ${{ inputs.repo }}
echo
echo "git status"
echo "-------------------------------------"
git status
echo "-------------------------------------"
echo
echo "git branch -v"
echo "-------------------------------------"
git branch -v -a
echo "-------------------------------------"
echo
echo "Contents"
echo "-------------------------------------"
ls -l .
echo "-------------------------------------"