From 8d3ab850aa6a86d13a7758a5a757a87c31ac7882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BRAMILLE?= <2752200+oktapodia@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:11:00 +0100 Subject: [PATCH] Add workflow --- .github/workflows/all-tokens.yml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/all-tokens.yml diff --git a/.github/workflows/all-tokens.yml b/.github/workflows/all-tokens.yml new file mode 100644 index 0000000..3057803 --- /dev/null +++ b/.github/workflows/all-tokens.yml @@ -0,0 +1,41 @@ +name: Add all.json containing all tokens on PR Merge + +on: + push: + # pull_request: + # types: [closed] + +jobs: + add-file: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install peerdeps + run: npm install -g install-peerdeps ts-node + + - name: Install dependencies + run: yarn install + + - name: Install peer dependencies + run: install-peerdeps -Y @lifi/sdk + + - name: Run generateAll.ts script + run: ts-node generateAll.ts + + - name: Commit and push changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add -f tokens/all.json + git commit -m "Update tokens/all.json on PR merge" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file