Calculate and output permissions #785
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Calculate and output permissions | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
push: | |
branches: | |
- main | |
permissions: write-all | |
jobs: | |
calculate-permissions: | |
name: Fetch all permissions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: npm install | |
- name: Setup env | |
uses: bgd-labs/github-workflows/.github/actions/env@main | |
with: | |
RPC_MAINNET: ${{secrets.RPC_MAINNET}} | |
RPC_POLYGON: ${{secrets.RPC_POLYGON}} | |
RPC_AVALANCHE: ${{secrets.RPC_AVALANCHE}} | |
RPC_OPTIMISM: ${{secrets.RPC_OPTIMISM}} | |
RPC_ARBITRUM: ${{secrets.RPC_ARBITRUM}} | |
RPC_METIS: ${{secrets.RPC_METIS}} | |
RPC_BASE: ${{secrets.RPC_BASE}} | |
- name: Generate json | |
run: npm run modifiers:generate | |
- name: Create tables | |
run: npm run tables:create | |
- name: check diff | |
run: | | |
if [[ -z $(git status -s) ]] | |
then | |
echo "tree is clean" | |
else | |
git config --global user.name 'test' | |
git config --global user.email 'test@test.com' | |
git config --global pull.rebase true | |
git add . | |
git commit -am "chore: tables update :robot:" | |
git pull origin main | |
git push | |
exit | |
fi |