-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (53 loc) · 1.48 KB
/
update.yml
File metadata and controls
57 lines (53 loc) · 1.48 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update
on:
workflow_dispatch:
inputs:
repo:
description: 'Repository'
default: unity-game-framework-actions/draft
required: true
branch:
description: 'Branch'
default: main
required: true
target:
description: 'Target'
default: .github
required: true
env:
repo: ${{ github.event.inputs.repo }}
branch: ${{ github.event.inputs.branch }}
sourceFolder: source
targetFolder: target
source: ${{ github.workspace }}/source/${{ github.event.inputs.target }}
target: ${{ github.workspace }}/target/${{ github.event.inputs.target }}
jobs:
main:
name: Main
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
token: ${{ secrets.userToken }}
repository: ${{ env.repo }}
ref: ${{ env.branch }}
path: ${{ env.sourceFolder }}
- name: Checkout Destination
uses: actions/checkout@v2
with:
token: ${{ secrets.userToken }}
ref: ${{ env.branch }}
path: ${{ env.targetFolder }}
- name: Update
run: |
rm -rf ${{ env.target }}
cp -r ${{ env.source }} ${{ env.target }}
- name: Push
run: |
cd ${{ github.workspace }}/${{ env.targetFolder }}
git config user.name ${{ secrets.userName }}
git config user.email ${{ secrets.userEmail }}
git add ${{ env.target }}
git commit -m "Update workflows"
git push