forked from repo-sync/github-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·23 lines (17 loc) · 513 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·23 lines (17 loc) · 513 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -e
if [[ -z "$GITHUB_TOKEN" ]]; then
echo "Set the GITHUB_TOKEN environment variable."
exit 1
fi
if [[ ! -z "$SSH_PRIVATE_KEY" ]]; then
echo "Saving SSH_PRIVATE_KEY"
mkdir --parents /root/.ssh
echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa
chmod 600 /root/.ssh/id_rsa
# Github action changes $HOME to /github at runtime
# therefore we always copy the SSH key to $HOME (aka. ~)
mkdir --parents ~/.ssh
cp /root/.ssh/* ~/.ssh/ 2> /dev/null || true
fi
sh -c "/github-sync.sh $*"