generated from Uniswap/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Uniswap/feat/update-script
Add script to update submodules daily
- Loading branch information
Showing
3 changed files
with
49 additions
and
129 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Update Submodules | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- staging | ||
- dev | ||
schedule: | ||
# Run this workflow daily at 03:17 UTC | ||
- cron: "17 3 * * *" | ||
|
||
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 | ||
- 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: Setup SSH | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.DEPLOY_KEY }} | ||
|
||
- name: Check for Changes | ||
id: git-check | ||
run: | | ||
echo "::set-output name=changes::$(git status --porcelain)" | ||
- 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 |