We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54040b0 commit 870ddf0Copy full SHA for 870ddf0
example-git.sh
@@ -0,0 +1,21 @@
1
+
2
+handler () {
3
+ set -e
4
5
+ EVENT_DATA=$1
6
+ echo $EVENT_DATA
7
8
+ REPO=$(echo $EVENT_DATA | jq ."repository")
9
+ mkdir -p /tmp/.ssh
10
+ aws s3 cp s3://bucket/id_rsa /tmp/.ssh/id_rsa
11
+ chmod 400 /tmp/.ssh/id_rsa
12
+ eval `ssh-agent -s`
13
+ export GIT_SSH="/tmp"
14
+ export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/tmp/.ssh/known_hosts -i /tmp/.ssh/id_rsa"
15
+ ssh-add /tmp/.ssh/id_rsa 2>&1
16
+ 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
20
+ echo "Successfully cloned repository" >&2
21
+}
0 commit comments