Skip to content

Commit e31be22

Browse files
committed
Update action params
1 parent b800d3e commit e31be22

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

action.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
source-repo:
66
description: "Source repository"
77
required: true
8-
source-folder:
8+
source-path:
99
description: "Source folder"
1010
required: true
1111
source-ref:
@@ -14,12 +14,18 @@ inputs:
1414
translations-repo:
1515
description: "Translations repository"
1616
required: true
17-
translations-folder:
17+
translations-path:
1818
description: "Translations folder"
1919
required: true
20+
translations-source-path:
21+
description: "Translations source folder"
22+
required: true
2023
translations-ref:
2124
description: "Translations reference"
2225
default: "main"
26+
auto-merge:
27+
description: "Automatically merge the PR"
28+
default: "false"
2329
gpg-private-key:
2430
description: "GPG private key of the user/email making the commits. Provided by the organization."
2531
required: true
@@ -58,11 +64,13 @@ runs:
5864
env:
5965
TOKEN: ${{ inputs.TOKEN }}
6066
INPUT_SOURCE-REPO: ${{ inputs.SOURCE-REPO }}
61-
INPUT_SOURCE-FOLDER: ${{ inputs.SOURCE-FOLDER }}
67+
INPUT_SOURCE-PATH: ${{ inputs.SOURCE-PATH }}
6268
INPUT_SOURCE-REF: ${{ inputs.SOURCE-REF }}
6369
INPUT_TRANSLATIONS-REPO: ${{ inputs.TRANSLATIONS-REPO }}
64-
INPUT_TRANSLATIONS-FOLDER: ${{ inputs.TRANSLATIONS-FOLDER }}
70+
INPUT_TRANSLATIONS-PATH: ${{ inputs.TRANSLATIONS-PATH }}
71+
INPUT_TRANSLATIONS-SOURCE-PATH: ${{ inputs.TRANSLATIONS-SOURCE-PATH }}
6572
INPUT_TRANSLATIONS-REF: ${{ inputs.TRANSLATIONS-REF }}
73+
INPUT_AUTO-MERGE: ${{ inputs.AUTO-MERGE }}
6674
GPG_NAME: ${{ steps.import-gpg.outputs.name }}
6775
GPG_EMAIL: ${{ steps.import-gpg.outputs.email }}
6876
run: |

main.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def sync_website_content(
153153
email : str
154154
Email of the bot account.
155155
"""
156+
end = "/" if translations_source_path.endswith("/") else ""
156157
base_path = Path(os.getcwd())
157158
base_source_path = base_path / source_repo.split("/")[-1]
158159
if source_path in ["/", ""]:
@@ -215,21 +216,17 @@ def sync_website_content(
215216
date_time = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
216217
branch_name = f"content-sync-{date_time}"
217218

219+
src = str(src_path) + end
220+
218221
if src_path.name == trans_path.name:
219222
dest = str(trans_path.parent)
220223
else:
221224
dest = str(trans_path)
222225

223-
if source_path in ["/", ""]:
224-
src = str(src_path) + "/"
225-
else:
226-
src = str(src_path)
227-
228226
run(["git", "checkout", "-b", branch_name], cwd=base_translations_path)
229227
os.makedirs(dest, exist_ok=True)
230228
run(["rsync", "-avr", "--delete", src, dest])
231229

232-
return
233230
run(["git", "status"], cwd=base_translations_path)
234231
run(["git", "add", "."], cwd=base_translations_path)
235232
_out, _err, rc = run(

0 commit comments

Comments
 (0)