From fd6294ee2aa33aa2fb2d650154427f7b8da8bd56 Mon Sep 17 00:00:00 2001 From: Sayantan Bose <140347263+sayantan-b@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:21:32 +0530 Subject: [PATCH] Added github workflow to whitelist retool dapps (#36) --- .../workflows/addWhitelistedRetoolDapps.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/addWhitelistedRetoolDapps.yml diff --git a/.github/workflows/addWhitelistedRetoolDapps.yml b/.github/workflows/addWhitelistedRetoolDapps.yml new file mode 100644 index 0000000..cfe6428 --- /dev/null +++ b/.github/workflows/addWhitelistedRetoolDapps.yml @@ -0,0 +1,45 @@ +name: Whitelist Retool Dapps + +on: + schedule: + - cron: '0 1,13 * * *' + +jobs: + run-script: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.12.0 + + - name: Install dependencies with yarn + run: yarn install + + - name: Set environment variables from secrets + run: | + touch .env + echo GOOGLE_CLIENT_EMAIL=${{ secrets.GOOGLE_CLIENT_EMAIL }} >> .env + echo RETOOL_DAPPS_SHEET_ID=${{ secrets.RETOOL_DAPPS_SHEET_ID }} >> .env + echo GOOGLE_PRIVATE_KEY=${{ secrets.GOOGLE_PRIVATE_KEY }} >> .env + cat .env + working-directory: ./scripts + + - name: Run the script with environment variable + run: node whitelistDapps.js + working-directory: ./scripts + + - name: Check for changes in reservedDappsName.json + run: | + git diff --quiet || { + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "GitHub Actions" + git add reservedDappNames.json + git commit -m "Update reservedDappNames.json" + git push origin HEAD + } + working-directory: ./scripts