Skip to content

Commit

Permalink
Use zuliprc from GH secrets for Zulip bot credential.
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and timabbott committed Jun 12, 2023
1 parent 0463348 commit 32e14bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ inputs:
# legacy
required: false
default: 'master'
zuliprc:
description: 'zuliprc of the Zulip bot'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
Expand Down
13 changes: 10 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ github_token=$INPUT_GITHUB_TOKEN
delete_history=$5
archive_branch=$6
github_personal_access_token=$7
zuliprc=$INPUT_ZULIPRC

github_personal_access_token=${github_personal_access_token:-NOT_SET}

Expand Down Expand Up @@ -62,9 +63,15 @@ github_pages_url=${github_pages_url_with_trailing_slash%/}
cp default_settings.py settings.py
cp $streams_config_file_path .

crudini --set zuliprc api site $zulip_organization_url
crudini --set zuliprc api key $zulip_bot_api_key
crudini --set zuliprc api email $zulip_bot_email
if [ -z "$zuliprc" ]; then
echo "Setting up Zulip details via 3 variables (zulip_organization_url, zulip_bot_key, zulip_bot_email)"
echo "is deprecated. The current simpler method is to just set the zuliprc content in the GH secrets."
crudini --set zuliprc api site "$zulip_organization_url"
crudini --set zuliprc api key "$zulip_bot_api_key"
crudini --set zuliprc api email "$zulip_bot_email"
else
echo "$zuliprc" > zuliprc
fi

export PROD_ARCHIVE=true
export SITE_URL=$github_pages_url
Expand Down

0 comments on commit 32e14bc

Please sign in to comment.