Created
September 3, 2021 20:54
-
-
Save maxlath/096fb50d3d9d8421dc404f278d057a6c to your computer and use it in GitHub Desktop.
Setup Wikidata OAuth credentials for wikibase-cli from environment variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Assuming that the workflow yaml file sets the following | |
# env: | |
# WD_CONSUMER_KEY: ${{ secrets.WD_CONSUMER_KEY }} | |
# WD_CONSUMER_SECRET: ${{ secrets.WD_CONSUMER_SECRET }} | |
# WD_TOKEN: ${{ secrets.WD_TOKEN }} | |
# WD_TOKEN_SECRET: ${{ secrets.WD_TOKEN_SECRET }} | |
echo "{ | |
\"credentials\": { | |
\"https://www.wikidata.org\": { | |
\"oauth\": { | |
\"consumer_key\": \"$WD_CONSUMER_KEY\", | |
\"consumer_secret\": \"$WD_CONSUMER_SECRET\", | |
\"token\": \"$WD_TOKEN\", | |
\"token_secret\": \"$WD_TOKEN_SECRET\" | |
} | |
} | |
} | |
}" > "$(wd config path)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment