File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -5,17 +5,19 @@ handler () {
5
5
EVENT_DATA=$1
6
6
echo $EVENT_DATA
7
7
8
- REPO=$( echo $EVENT_DATA | jq ." repository" )
8
+ REPO=$( echo $EVENT_DATA | jq -r ." repository" )
9
+ OWNER=$( echo $EVENT_DATA | jq -r ." owner" )
10
+ BUCKET=$( echo $EVENT_DATA | jq -r ." bucket" )
9
11
mkdir -p /tmp/.ssh
10
- aws s3 cp s3://bucket /id_rsa /tmp/.ssh/id_rsa
12
+ aws s3 cp s3://$BUCKET /id_rsa /tmp/.ssh/id_rsa
11
13
chmod 400 /tmp/.ssh/id_rsa
12
14
eval ` ssh-agent -s`
13
15
export GIT_SSH=" /tmp"
14
16
export GIT_SSH_COMMAND=" ssh -o UserKnownHostsFile=/tmp/.ssh/known_hosts -i /tmp/.ssh/id_rsa"
15
17
ssh-add /tmp/.ssh/id_rsa 2>&1
16
18
ssh-keyscan github.com >> /tmp/.ssh/known_hosts 2>&1
17
- git clone ssh://git@github.com/owner/repo .git /tmp/repo 2>&1
18
- ls -al /tmp/repo
19
+ git clone ssh://git@github.com/$OWNER / $REPO .git /tmp/$REPO 2>&1
20
+ ls -al /tmp/$REPO
19
21
20
22
echo " Successfully cloned repository" >&2
21
23
}
You can’t perform that action at this time.
0 commit comments