Skip to content

Commit

Permalink
add submodule when transpiling
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Sep 29, 2023
1 parent 1e208bf commit 415e54f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/upgradeable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ jobs:
- run: bash scripts/git-user-config.sh
- name: Transpile to upgradeable
run: bash scripts/upgradeable/transpile-onto.sh ${{ github.ref_name }} origin/${{ github.ref_name }}
env:
REMOTE: https://github.com/${{ github.repository }}.git
- run: git push origin ${{ github.ref_name }}
14 changes: 11 additions & 3 deletions scripts/upgradeable/transpile-onto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,17 @@ else
fi
fi

# commit if there are changes to commit
if ! git diff --quiet --cached; then
git commit -m "Transpile $commit"
# abort if there are no changes to commit at this point
if git diff --quiet --cached; then
exit
fi

if [[ -v REMOTE ]]; then
lib=lib/openzeppelin-contracts
git submodule add -b "$branch" "$REMOTE" "$lib"
git -C "$lib" checkout "$commit"
git add "$lib"
fi

git commit -m "Transpile $commit"
git checkout "$branch"

0 comments on commit 415e54f

Please sign in to comment.