-
Notifications
You must be signed in to change notification settings - Fork 4
31 lines (26 loc) · 1.04 KB
/
Copy pathduplicate_sample.yml
File metadata and controls
31 lines (26 loc) · 1.04 KB
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
name: Duplicate Package Sample Workflow
on:
push:
branches: [main]
jobs:
duplicate:
name: Duplicate Project Samples
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run duplicate script file
run: |
export SOURCE_DIRECTORY="${GITHUB_WORKSPACE}/src/SampleProject/Assets/Samples/CereBro.Unity/1.0.5/CereBro.Unity Sample/"
export DESTINATION_DIRECTORY="${GITHUB_WORKSPACE}/Packages/com.cerebro.unity/Samples~/CereBro.Unity Sample/"
rm -r "$DESTINATION_DIRECTORY"
cp -r "$SOURCE_DIRECTORY" "$DESTINATION_DIRECTORY"
- name: Commit and Push
run: |
git config user.email $git_email
git config user.name "${{ github.actor }}"
git add "./Packages/com.cerebro.unity/Samples~/CereBro.Unity Sample/" -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"