From 488774d57e543a5c7a2c634af459e48463b43164 Mon Sep 17 00:00:00 2001 From: Jerko J <83344666+JJ-Cro@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:39:18 +0200 Subject: [PATCH 1/3] feat(): added automatic Readme actions --- .github/workflows/templates-readme.yml | 89 ++++++++++++++++++++++++++ README.md | 54 ++++++++++------ 2 files changed, 123 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/templates-readme.yml diff --git a/.github/workflows/templates-readme.yml b/.github/workflows/templates-readme.yml new file mode 100644 index 0000000..dfea309 --- /dev/null +++ b/.github/workflows/templates-readme.yml @@ -0,0 +1,89 @@ +name: Update README.md templates + +on: + workflow_dispatch: + +permissions: + contents: write # Grant write permissions to the contents + +env: + FILE_NAME: README.md + +jobs: + update-readme: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: https://registry.npmjs.org/ + cache: 'npm' + + - name: Install + run: npm ci --ignore-scripts + + - name: Get the current date and time + id: datetime + run: echo "BRANCH_NAME=$(date +'actions_templates_%Y_%m_%d_%H%M%S')" >> $GITHUB_ENV + + - name: Create update-template.sh script + run: | + cat << 'EOF' > update-template.sh + #!/bin/bash + + TEMPLATE_VALUE=$(curl -s $TEMPLATE_URL) + + perl -0777 -i -pe " + my \$tag = quotemeta(''); + my \$end_tag = quotemeta(''); + my \$replacement = '${TEMPLATE_VALUE}'; + + # Match the tag, then any amount of whitespace (including newlines), then the replacement, then any amount of whitespace, then the end tag. + s/(\$tag)(\s*)(.*?)(\s*)(\$end_tag)/\$1\n\$replacement\n\$5/s; + " "$FILE_NAME" + + EOF + chmod +x update-template.sh + cat update-template.sh + + - name: Fetch and update RELATED PROJECTS template + run: ./update-template.sh + env: + TEMPLATE_URL: https://raw.githubusercontent.com/wiki/tiagosiebler/awesome-crypto-examples/Related-projects.md + TEMPLATE_TAG: related_projects + + - name: Fetch and update CONTRIBUTIONS template + run: ./update-template.sh + env: + TEMPLATE_URL: https://raw.githubusercontent.com/wiki/tiagosiebler/awesome-crypto-examples/Contributions-%26-Thanks.md + TEMPLATE_TAG: contributions + + - name: Fetch and update STAR HISTORY template + run: ./update-template.sh + env: + TEMPLATE_URL: https://raw.githubusercontent.com/wiki/tiagosiebler/awesome-crypto-examples/Star-History.md + TEMPLATE_TAG: star_history + + - name: Check for changes before running linter + run: git diff + + - name: Check for changes | PR URL HERE + id: commitIfChanged + run: | + npx prettier -w README.md + if git diff --quiet; then + echo "No changes to commit" + exit 0 + fi + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git checkout -b ${{ env.BRANCH_NAME }} + git add $FILE_NAME + git commit -m 'chore(): ${{ env.FILE_NAME }} template sections' + git push origin ${{ env.BRANCH_NAME }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index ab1b8e1..374bb4d 100644 --- a/README.md +++ b/README.md @@ -26,20 +26,25 @@ Updated & performant JavaScript & Node.js SDK for the Bitget V2 REST APIs and We - Issues? Check the [issues tab](https://github.com/tiagosiebler/bitget-api/issues). - Discuss & collaborate with other node devs? Join our [Node.js Algo Traders](https://t.me/nodetraders) engineering community on telegram. + + ## Related projects -Check out my related projects: +Check out my related JavaScript/TypeScript/Node.js projects: -- Try my connectors: - - [binance](https://www.npmjs.com/package/binance) - - [bybit-api](https://www.npmjs.com/package/bybit-api) - - [okx-api](https://www.npmjs.com/package/okx-api) - - [bitget-api](https://www.npmjs.com/package/bitget-api) - - [ftx-api](https://www.npmjs.com/package/ftx-api) +- Try my REST API & WebSocket SDKs: + - [Bybit-api Node.js SDK](https://www.npmjs.com/package/bybit-api) + - [Okx-api Node.js SDK](https://www.npmjs.com/package/okx-api) + - [Binance Node.js SDK](https://www.npmjs.com/package/binance) + - [Gateio-api Node.js SDK](https://www.npmjs.com/package/gateio-api) + - [Bitget-api Node.js SDK](https://www.npmjs.com/package/bitget-api) + - [Bitmart-api Node.js SDK](https://www.npmjs.com/package/bitmart-api) - Try my misc utilities: - - [orderbooks](https://www.npmjs.com/package/orderbooks) + - [OrderBooks Node.js](https://www.npmjs.com/package/orderbooks) + - [Crypto Exchange Account State Cache](https://www.npmjs.com/package/accountstate) - Check out my examples: - - [awesome-crypto-examples](https://github.com/tiagosiebler/awesome-crypto-examples) + - [awesome-crypto-examples Node.js](https://github.com/tiagosiebler/awesome-crypto-examples) + ## Documentation @@ -209,24 +214,33 @@ The bundle can be found in `dist/`. Altough usage should be largely consistent, --- -## Contributions & Thanks - -### Donations + -#### tiagosiebler +Have my projects helped you? Share the love, there are many ways you can show your thanks: -Support my efforts to make algo trading accessible to all - register with my referral links: +- Star & share my projects. +- Are my projects useful? Sponsor me on Github and support my effort to maintain & improve them: https://github.com/sponsors/tiagosiebler +- Have an interesting project? Get in touch & invite me to it. +- Or buy me all the coffee: + - ETH(ERC20): `0xA3Bda8BecaB4DCdA539Dc16F9C54a592553Be06C` -- [Bybit](https://www.bybit.com/en-US/register?affiliate_id=9410&language=en-US&group_id=0&group_type=1) -- [Binance](https://www.binance.com/en/register?ref=20983262) -- [Bitget](https://partner.bitget.com/bg/ZNM295) -- [OKX](https://www.okx.com/join/18504944) -- [FTX](https://ftx.com/referrals#a=ftxapigithub) + + ### Contributions & Pull Requests Contributions are encouraged, I will review any incoming pull requests. See the issues tab for todo items. + + ## Star History -[![Star History Chart](https://api.star-history.com/svg?repos=tiagosiebler/bitget-api,tiagosiebler/bybit-api,tiagosiebler/binance,tiagosiebler/orderbooks,tiagosiebler/okx-api,tiagosiebler/awesome-crypto-examples,tiagosiebler/ftx-api&type=Date)](https://star-history.com/#tiagosiebler/bitget-api&tiagosiebler/bybit-api&tiagosiebler/binance&tiagosiebler/orderbooks&tiagosiebler/okx-api&tiagosiebler/awesome-crypto-examples&tiagosiebler/ftx-api&Date) +[![Star History Chart](https://api.star-history.com/svg?repos=tiagosiebler/bybit-api,tiagosiebler/okx-api,tiagosiebler/binance,tiagosiebler/bitget-api,tiagosiebler/bitmart-api,tiagosiebler/gateio-api,tiagosiebler/kucoin-api,tiagosiebler/orderbooks,tiagosiebler/accountstate,tiagosiebler/awesome-crypto-examples&type=Date)](https://star-history.com/#tiagosiebler/bybit-api&tiagosiebler/okx-api&tiagosiebler/binance&tiagosiebler/bitget-api&tiagosiebler/bitmart-api&tiagosiebler/gateio-api&tiagosiebler/kucoin-api&tiagosiebler/orderbooks&tiagosiebler/accountstate&tiagosiebler/awesome-crypto-examples&Date) + + From 269c3dcd51f6c29f1908fb670c78c879fa8a8e96 Mon Sep 17 00:00:00 2001 From: Jerko J <83344666+JJ-Cro@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:56:37 +0200 Subject: [PATCH 2/3] chore(): fixed warning --- .github/workflows/templates-readme.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/templates-readme.yml b/.github/workflows/templates-readme.yml index dfea309..b5fc135 100644 --- a/.github/workflows/templates-readme.yml +++ b/.github/workflows/templates-readme.yml @@ -87,3 +87,5 @@ jobs: git push origin ${{ env.BRANCH_NAME }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FILE_NAME: ${{ env.FILE_NAME }} + BRANCH_NAME: ${{ env.BRANCH_NAME }} From 18a8fa811da192935ae6b790e91de021fe409cfd Mon Sep 17 00:00:00 2001 From: Jerko J <83344666+JJ-Cro@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:21:25 +0200 Subject: [PATCH 3/3] chore(): updated readme actions --- .github/workflows/templates-readme.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/templates-readme.yml b/.github/workflows/templates-readme.yml index b5fc135..dfea309 100644 --- a/.github/workflows/templates-readme.yml +++ b/.github/workflows/templates-readme.yml @@ -87,5 +87,3 @@ jobs: git push origin ${{ env.BRANCH_NAME }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FILE_NAME: ${{ env.FILE_NAME }} - BRANCH_NAME: ${{ env.BRANCH_NAME }}