-
Notifications
You must be signed in to change notification settings - Fork 50
63 lines (53 loc) · 1.79 KB
/
sync-mainnet-fulllist.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Sync on chain Token List
on:
# This job is scheduled to run:
schedule:
- cron: '0 12 * * *' # Every day at 12:00
jobs:
build:
if: github.repository == 'Consensys/linea-token-list'
runs-on: ubuntu-latest
env:
PROVIDER_URL: ${{ secrets.PROVIDER_URL }}
LINEA_PROVIDER_URL: ${{ secrets.LINEA_PROVIDER_URL }}
CONTRACT_ADDRESS: ${{ secrets.CONTRACT_ADDRESS }}
L2_TOKEN_BRIDGE: ${{ secrets.L2_TOKEN_BRIDGE }}
HAS_CHANGES: false
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Execute syncMainnetFulllist
run: npm run start
- name: Check for changes
run: |
if [[ -n $(git diff --exit-code) ]]; then
echo "Changes detected. Creating a Pull Request."
echo "HAS_CHANGES=true" >> $GITHUB_ENV
else
echo "No changes detected. Skipping pull request creation."
exit 0
fi
- name: Create Pull Request
id: create-pr
if: env.HAS_CHANGES == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
committer: GitHub <[email protected]>
delete-branch: true
title: 'Update linea-mainnet-token-fulllist.json'
branch: token-automatic-list
base: main
- name: Pull Request Automerge
if: env.HAS_CHANGES == 'true'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }}
merge-method: squash