Skip to content

Commit 399e82c

Browse files
committed
Added copy-to-dist workflow
1 parent 6f52c8b commit 399e82c

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/copy-to-dist.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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 }}

0 commit comments

Comments
 (0)