generated from Uniswap/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (56 loc) · 1.7 KB
/
update-interfaces.yaml
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
64
65
66
name: Update Interfaces
on:
workflow_dispatch:
push:
branches:
- main
- staging
jobs:
update-interfaces:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Clone Interfaces Repository
run: |
git clone https://github.com/Uniswap/interfaces.git tmp_interfaces_repo
- name: Compile Interfaces
run: |
./script/util/compile_interfaces.sh tmp_interfaces_repo/src
- name: Check for Changes
id: git-check
run: |
cd tmp_interfaces_repo
if [ -n "$(git status --porcelain)" ]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY_INTERFACES }}
- name: Commit and Push if Changes are Present
if: steps.git-check.outputs.changes == 'true'
run: |
cd tmp_interfaces_repo
git remote set-url origin [email protected]:Uniswap/interfaces.git
git add .
git commit -m "Update interfaces
Changes:
$(git diff --cached --name-status)
"
git pull --rebase origin main
git push