File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Copy to dist
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ source-branch :
7+ default : ' main'
8+ required : false
9+ type : string
10+ target-repository :
11+ required : true
12+ type : string
13+ target-branch :
14+ default : ' main'
15+ required : false
16+ type : string
17+ target-username :
18+ default : ' Julien Ruaux'
19+ required : false
20+ type : string
21+ files :
22+ default : ' README.adoc'
23+ required : false
24+ type : string
25+ secrets :
26+ github-user :
27+ required : false
28+ github-token :
29+ required : true
30+
31+ jobs :
32+ release :
33+ name : Copy to repo
34+ runs-on : ubuntu-latest
35+ steps :
36+ - name : Checkout source
37+ uses : actions/checkout@v4
38+ with :
39+ ref : ${{ inputs.source-branch }}
40+ path : ' source'
41+ - name : Checkout target
42+ uses : actions/checkout@v4
43+ with :
44+ repository : ${{ inputs.target-repository }}
45+ ref : ${{ inputs.target-branch }}
46+ path : ' target'
47+ - name : Copy to target
48+ run : |
49+ cd source
50+ cp ${{ inputs.files }} ../target/
51+ cd ../target
52+ git add ${{ inputs.files }}
53+ git config --global user.email "${{ secrets.COMMIT_EMAIL }}"
54+ git config --global user.name "${{ inputs.target-username }}"
55+ git commit --allow-empty -a -m "Copy files from source repo"
56+ git push origin ${{ inputs.target-branch }}
You can’t perform that action at this time.
0 commit comments