generated from Uniswap/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 14
54 lines (47 loc) · 1.35 KB
/
update-submodules.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
name: Update Submodules
on:
workflow_dispatch:
push:
branches:
- main
- staging
- dev
schedule:
# Run this workflow hourly at *:17 UTC
- cron: "17 * * * *"
jobs:
update-submodules:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update Submodules
run: |
git submodule update --init --remote src/pkgs
- 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: Check for Changes
id: git-check
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changes=changes present" >> $GITHUB_OUTPUT
else
echo "changes=" >> $GITHUB_OUTPUT
fi
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: Commit and Push if Changes are Present
if: steps.git-check.outputs.changes != ''
run: |
git remote set-url origin [email protected]:${{ github.repository }}.git
git add .
git commit -m "Update submodules"
git push