Skip to content

Commit

Permalink
feat: Output fully qulalified URL to make requests
Browse files Browse the repository at this point in the history
  This is useful when passing admin credentials as they can be included
  in the URL itself.
  • Loading branch information
taratatach committed Dec 14, 2022
1 parent 57a520c commit bff253e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
couchdb password:
description: 'Password of the admin user.'
required: false
outputs:
couchdb-url:
description: 'Base URL to make requests to CouchDB.'
runs:
using: 'docker'
image: 'Dockerfile'
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ echo "Setting up CouchDB system databases..."
docker exec $NAME curl -sS $CURL_CREDENTIALS 'http://127.0.0.1:5984/_users' -X PUT -H 'Content-Type: application/json' --data '{"id":"_users","name":"_users"}' > /dev/null
docker exec $NAME curl -sS $CURL_CREDENTIALS 'http://127.0.0.1:5984/_global_changes' -X PUT -H 'Content-Type: application/json' --data '{"id":"_global_changes","name":"_global_changes"}' > /dev/null
docker exec $NAME curl -sS $CURL_CREDENTIALS 'http://127.0.0.1:5984/_replicator' -X PUT -H 'Content-Type: application/json' --data '{"id":"_replicator","name":"_replicator"}' > /dev/null

COUCHDB_URL="http://$INPUT_COUCHDB_PASSWORD:$INPUT_COUCHDB_PASSWORD@localhost:5984"
echo "couchdb-url=$(echo $COUCHDB_URL)" >> $GITHUB_OUTPUT

0 comments on commit bff253e

Please sign in to comment.