diff --git a/.github/workflows/wallets-check.yml b/.github/workflows/wallets-check.yml new file mode 100644 index 00000000000..4d07cf98a83 --- /dev/null +++ b/.github/workflows/wallets-check.yml @@ -0,0 +1,32 @@ +name: Check Wallet Data for "new_to_crypto: true" + +on: + pull_request: + paths: + - 'data/wallets/wallet-data.ts' + +jobs: + check_new_to_crypto: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Check for "new_to_crypto: true" + id: check_new_to_crypto + run: | + if git diff --name-only HEAD^ | grep -q "data/wallets/wallet-data.ts"; then + if git diff -U0 HEAD^ HEAD data/wallets/wallet-data.ts | grep -q "+.*new_to_crypto: true"; then + echo "New wallet added with 'new_to_crypto: true'" + echo "::set-output name=new_to_crypto_found::true" + else + echo "::set-output name=new_to_crypto_found::false" + fi + fi + + - name: Comment on PR if "new_to_crypto: true" is added + if: steps.check_new_to_crypto.outputs.new_to_crypto_found == 'true' + uses: actions-ecosystem/action-add-comment@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + comment: "A wallet has been added with 'new_to_crypto: true'. Please ensure this meets our guidelines."