Skip to content

add test interface

add test interface #3

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 push