-
Notifications
You must be signed in to change notification settings - Fork 18
61 lines (58 loc) · 1.75 KB
/
language-push.yaml
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
58
59
60
61
name: Push languages files to private repositories
on:
push:
branches:
- main
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
-
name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2
-
name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files_ignore: .github/**
json: true
-
name: Set matrix value
id: set-matrix
run: echo "::set-output name=matrix::${{ steps.changed-files.outputs.all_changed_files }}}"
push:
needs: [ setup ]
runs-on: ubuntu-latest
strategy:
matrix:
value: ${{fromJson(needs.setup.outputs.matrix)}}
steps:
-
name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2
-
name: Extract folder name of the path
id: folder-name
run: |
echo "REPOSITORY=$(echo "${{ matrix.value }}" | cut -d'/' -f 1)" >> $GITHUB_ENV
echo "TARGET_FOLDER=$(echo "${{ matrix.value }}" | cut -d'/' -f 2- | rev | cut -d '/' -f 2- | rev)" >> $GITHUB_ENV
-
name: Push file
uses: dmnemec/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.PAT }}
with:
source_file: ${{ matrix.value }}
destination_repo: ${{ github.REPOSITORY_OWNER }}/${{ env.REPOSITORY }}
destination_folder: lua/${{ env.TARGET_FOLDER }}
user_email: [email protected]
user_name: github-actions
commit_message: Synchronize language from public repository
destination_branch: develop