clearloop / leetcode-cli

May the code be with you 👻
MIT License
308 stars 49 forks source link

Add CI for command pick and test #123

Open clearloop opened 1 year ago

clearloop commented 1 year ago

hmmm, need to set the csrf token and session key to the env of CI

This may require loading csrf and session from env

anstadnik commented 1 year ago

You can set GH Actions secrets, then write those into a config file, and read them. I assume they won't be obtainable from outside. The problem is that they could expire.

clearloop commented 1 year ago

yeah, it is possible to replace the new generated csrf and session key with bash script as well!

./target/release/leetcode list # just trigger the config generation logic
sed -i /csrf=\"\"/csrf=\"...\"/ ~/.leetcode/leetcode.toml 
sed -i /session=\"\"/session=\"...\"/ ~/.leetcode/leetcode.toml 
cp anwser.1-sum-two.rs > ~/.leetcode/code
leetcode t 1