-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automated duplicating imported samples modifications (#595)
* automated duplicating imported samples modifications using pre-commit and a bash script duplicate_package_sample.sh * Pre Commit config file added * added bash execution in pre commit config file * entry path changed * entry changed * entry path changed * added always run to pre-commit * changed type * removed pre-commit config yaml brought back GitHub workflow solution * extra commit author changed to git actor * workflow working branch switched back to main --------- Co-authored-by: Peter Kalambet <[email protected]>
- Loading branch information
Showing
6 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
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,28 @@ | ||
name: Duplicate-Package-Sample | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
duplicate: | ||
name: duplicate package sample | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run duplicate script file | ||
run: bash ${GITHUB_WORKSPACE}/duplicate_package_sample.sh | ||
|
||
- name: Commit and Push | ||
run: | | ||
git config --global user.email $git_email | ||
git config --global user.name "${{ github.actor }}" | ||
git add ./src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/. -f | ||
git diff-index --cached --quiet HEAD || git commit -m "Auto-duplicate Package Samples" | ||
git push | ||
env: | ||
git_email: "${{ github.actor }}@users.noreply.github.com" |
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,14 @@ | ||
#!/bin/bash | ||
|
||
# Specify the source directory and the destination directory | ||
SOURCE_DIRECTORY="src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.5.0-pre001/Web3.Unity Samples/" | ||
DESTINATION_DIRECTORY="src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/" | ||
|
||
# clear destination directory first | ||
rm -r "$DESTINATION_DIRECTORY" | ||
|
||
# Copy source to the destination | ||
cp -r "$SOURCE_DIRECTORY" "$DESTINATION_DIRECTORY" | ||
|
||
#add all modified files | ||
git add "src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/." -f |
8 changes: 8 additions & 0 deletions
8
src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Prefabs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scenes.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Scripts.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/UnityPackages/io.chainsafe.web3-unity/Samples~/Web3.Unity/Sprites.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.