action-gitea-mirror/entrypoint.sh

24 lines
1.2 KiB
Bash
Raw Normal View History

2020-10-16 22:27:36 +08:00
#!/bin/sh
set -eu
2020-10-16 22:40:56 +08:00
gh_username="$INPUT_GH_USERNAME"
accesstoken="$INPUT_ACCESSTOKEN"
gitea_host="$INPUT_GITEA_HOST"
gitea_username="$INPUT_GITEA_USERNAME"
gitea_accesstoken="$INPUT_GITEA_ACCESSTOKEN"
gitea_gist_prefix="$INPUT_GITEA_GIST_PREFIX"
gitea_gist_surfix="$INPUT_GITEA_GIST_SURFIX"
gistsSource="$INPUT_GISTSSOURCE"
gistsStared="$INPUT_GISTSSTARED"
repositoryStared="$INPUT_REPOSITORYSTARED"
repositorySource="$INPUT_REPOSITORYSOURCE"
repositoryForked="$INPUT_REPOSITORYFORKED"
2020-10-16 22:27:36 +08:00
2020-10-16 23:04:26 +08:00
echo "###[group] Setting Up Config"
template='{"github":{"username":"%s","accesstoken":"%s"},"gitea":{"host":"%s","accesstoken":"%s","username":"%s","default_userpassword":"RY7VpBD62P7964c9$mSz%2GAM82hv68yUbHc4@Gdw8c%f^W3*qdzo$f*8a6b^rKy","gist":{"prefix":"%s","surfix":"%s"}},"repomap":{},"gistsSource":%s,"gistsStared":%s,"repositoryStared":%s,"repositorySource":%s,"repositoryForked":%s}'
json_string=$(printf "$template" "$gh_username" "$accesstoken" "$gitea_host" "$gitea_accesstoken" "$gitea_username" "$gitea_gist_prefix" "$gitea_gist_surfix" "$gistsSource" "$gistsStared" "$repositoryStared" "$repositorySource" "$repositoryForked")
echo "$json_string" >> config.json
cat config.json
echo "###[endgroup]"